10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have a comma delimited file of major codes and descriptions. I want to replace all occurrences of spaces with underscores up to the first comma (only in the first field), but not replace spaces following the comma. For instance I have the following snippet of the file:
EK ED,Elementary and... (7 Replies)
Discussion started by: tdouty
7 Replies
2. Shell Programming and Scripting
All, I've searched and haven't found a solution for my particular issue.
I have a file with lines of data that contain varying amounts of underscores imbedded. But all the strings have a final underscore and an interface name:
dmk_hcn_dalian2.XXXX.XXX.XX.COM_Se0/0/0... (4 Replies)
Discussion started by: turk22
4 Replies
3. Shell Programming and Scripting
I need to change the order of the columns of data that looks like this:
The original data is in 6 tab-separated columns.
FACTSHEET factsheet NN 1 5 DEP
WHAT what WP 2 3 SBJ
IS be VBZ 3 1 NMOD
AIDS AIDS NP ... (1 Reply)
Discussion started by: owwow14
1 Replies
4. UNIX for Dummies Questions & Answers
Hello,
I have a file, inputs.list that contain prefixes to files that are inputs for a program
inputs.list
A
B
C
D
E
...
My files are of the format A_1, A_2, B_1, B_2 and so on. I am planning to run a shell script that takes each line from the above file and feed it to the runProg.sh... (3 Replies)
Discussion started by: Gussifinknottle
3 Replies
5. Shell Programming and Scripting
Hi
I want to filter my files which has more than 1 underscores in it.how can i achieve this.
Ex: if my file name is a_b_c, a_b.
my command should result only a_b_c
Thanks
Pracheth (10 Replies)
Discussion started by: pracheth
10 Replies
6. Shell Programming and Scripting
Hi
i have a variable var=a_b_c
i want command to find no. of underscores in a variable
Thank you (7 Replies)
Discussion started by: pracheth
7 Replies
7. Shell Programming and Scripting
Hi,
Here is my question,
I need to extract string between two underscores from the filename
for example, filename is
atmos_8xdaily_instant_300x300_1_12.nc
what I want to extract is 300x300.
There are many such files in my directory, so I guess the code should be like:
for file... (7 Replies)
Discussion started by: 1988PF
7 Replies
8. UNIX for Dummies Questions & Answers
Hi,
I have a problem where I need to append few spaces(say 10 spaces) for each line in a file whose length is say(100 chars) and others leave as it is.
I tried to find the length of each line and then if the length is say 100 chars then tried to write those lines into another file and use a sed... (17 Replies)
Discussion started by: prathima
17 Replies
9. Shell Programming and Scripting
Greetings,
I have a bunch of music files that I want to strip the underscores out, and leave only spaces. All that I've found on the web is how to add underscores to files that have spaces, and reversing the "tr" command does not make a difference.
Here is how to convert spaces to... (6 Replies)
Discussion started by: brakeb
6 Replies
10. Shell Programming and Scripting
I am trying to strip all leading and trailing spaces of a shell variable using either awk or sed or any other utility, however unscuccessful and need your help.
echo $SH_VAR | command_line Syntax.
The SH_VAR contains embedded spaces which needs to be preserved. I need only for the leading and... (6 Replies)
Discussion started by: jerardfjay
6 Replies