All Questions
11 questions
0
votes
1
answer
2k
views
how to replace spaces in a string with '\ ' in bash
I'm writing a bash script that prints the contents of a file called website (using cat) that is inside a folder with a space in it's name, for example folder 1. but I can't make bash get the path ...
0
votes
1
answer
197
views
Bash - Convert problematic space-separated table to semicolon-delimeted list
I have a program that outputs many lines of data in a space-separated table. I need to convert this output to a semicolon-separated list.
This is an example record. Each field has a set number of ...
0
votes
2
answers
1k
views
How to split a text file so that each paragraph is its own file?
I have a long list of urls, and I'm trying to make a shell script to split each paragraph, separated by newline, into its own file. The files would need to be numbered
001
002
003
...
and so on. ...
4
votes
3
answers
695
views
Parsing csv file to filter rows based on a matching set of characters from a column value
Consider the following csv file:
A,3300
B,8440
B,8443
B,8444
C,304
C,404
M,5502
M,5511
The actual csv file is big (around 60,000 rows). I have only included a small version to describe ...
3
votes
2
answers
3k
views
Command for converting rows to CSV file
I have a file of the format, with a leading space before each line:
"Western Overseas",
"Western Overseas",
"^",
"--",
"^",
"--",
"--",
null,
24995,
9977,
"CR",
"Western Refrigeration ...
1
vote
3
answers
1k
views
How to move lines containing specific strings to top of file?
How can I move lines containing specific strings (ie. 005, and 007) to the top of the target file?
Contents of target file:
XXX_008
XXX_001
XXX_002
XXX_009
XXX_003
XXX_006
XXX_005 ----> located ...
0
votes
3
answers
113
views
Combining multiple columns and insert information in middle
I have to 3 files with all containing columns of information
id.file
1
2
3
name.file
Josh
Kate
Chris
lastname.file
Smith
Jones
Black
And I would like to combine them in a way, so I can get ...
-1
votes
3
answers
2k
views
Swapping the contents of two columns
I am trying to understand cut better and moving cut data to another file. I have a file called numbers with two columns. Each column is separated with one tab.
I am trying to swap the columns by ...
3
votes
0
answers
89
views
Git - prune every whitespace-separated word originally introduced by specific author in project's history
We have a project under git revision control with only a single branch. We need to remove every new whitespace-separated word that was introduced for the first ever time in a given file by a specific ...
3
votes
2
answers
395
views
Sorting image files using header information
I have multiple image files inside a directory having the same extension (.mrc). In the terminal, if I do, header , it gives following output:
RO image file on unit 1 : ...
7
votes
3
answers
2k
views
Format column-based text file into tree structure using bash
Is there a Unix/Linux command that can turn this:
AMERICA USA NEW_YORK AB-100
AMERICA USA NEW_YORK VF-200
AMERICA USA NEW_YORK XY-243
AMERICA USA LOS_ANGELES UH-198
AMERICA CANADA TORONTO ...