10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
I have the requirement similar to the one mentioned in the below thread.
https://www.unix.com/unix-for-dummies-questions-and-answers/128155-search-replace-string-only-particular-column-delimited-file.html
The only difference is that I need to change the field for row 1,2 and the last... (14 Replies)
Discussion started by: chetanojha
14 Replies
2. Shell Programming and Scripting
Hello everyone,
I am comparing two floating point numbers by storing them in seperate files and then using difference command to verify,it is working fine.
But I want to compare two values which will come at 4 precision places.
ex:
file1
Date,Count,Checksum... (7 Replies)
Discussion started by: karthik adiga
7 Replies
3. Shell Programming and Scripting
Hi,
I have a '~' delimited file and i want to remove the last field using awk. Please find the sample records below:
1428128~1~0~1100426~003~50220~005~14~0~194801~11~0~3~14~0~50419052335~0~0820652001~2~00653862 ~0~1~0~00126~1~20000110~20110423~R~ ~0~Z~1662.94~ ~002041~0045~Z~... (3 Replies)
Discussion started by: Arun Mishra
3 Replies
4. Shell Programming and Scripting
Hi
I have a file with fields delimited by |. I need to remove the first field from the file. I tried cut but it just extracts that field.
sample.output
abc|100|name1
cde|200|name2
efg|300|name3
Output should be
sample.output
100|name1
200|name2
300|name3
thanks
Var (6 Replies)
Discussion started by: var285
6 Replies
5. UNIX for Dummies Questions & Answers
Hello,
I have a file with several lines and I need to trim and pad with spaces the data that are between position 6 and 15 included. Data in position 1 to 5 and after 15 could be anything, and should stay as they are.
For instance, the following records in a file (underscore = space)... (4 Replies)
Discussion started by: BSF
4 Replies
6. Shell Programming and Scripting
Hi Forum.
I tried searching the forum but couldn't find a solution for my question.
I have the following data and would like to have a sed syntax to remove the leading zeroes from the 2nd field only:
Before:
2010-01-01|123|1|1000|2000|500|1500|600|700... (18 Replies)
Discussion started by: pchang
18 Replies
7. UNIX for Dummies Questions & Answers
Hello,
I have about 100 files in a directory with fields which are tab delimited. I would like to append the file name as the first field and it has to be done as many times as the total lines in the file.
For example,
myFile1.txt has the following data:
1 x y z
2 a b ... (5 Replies)
Discussion started by: Gussifinknottle
5 Replies
8. Shell Programming and Scripting
Hello,
Can someone help me to do this with awk or sed? I have a file with multiple lines, each line has many fields separated with a tab. I would like to add one more field holding 'na' in between the first and second fields.
old file looks like,
1, field1 field2 field3 ...
2, field1... (7 Replies)
Discussion started by: ssshen
7 Replies
9. Shell Programming and Scripting
I have a large file with fields delimited by '|', and I want to run some analysis on it. What I want to do is count how many times each field is populated, or list the frequency of population for each field.
I am in a Sun OS environment.
Thanks,
- CB (3 Replies)
Discussion started by: ChicagoBlues
3 Replies
10. Shell Programming and Scripting
How do I trim the leading zeroes, and (+,-) in the currency field ?
I have a text file.
Your bill of +00002780.96 for a/c no. 25287324 is due on 11-06.
Your bill of +00422270.48 for a/c no. 28931373 is due on 11-06.
I want the O/P file to be like.
Your bill of 2780.96 for a/c no. 25287324... (22 Replies)
Discussion started by: Amruta Pitkar
22 Replies