10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
I have a data like
Input:
12||34|56|78
Output:
XYZ|12||34|56|78
I tried like this , but it puts it on another line
awk -F "|" ' BEGIN {"XYZ"} {print $0} 'file
Any quick suggessitons in sed/awk ? am using HP-UX (3 Replies)
Discussion started by: selvankj
3 Replies
2. Shell Programming and Scripting
A file
2400 2800 PSC000289
3200 3896 PCS000289
3333 3666 PCS000221
222 1000 PCS000222
3299 3600 PSC000289
Question is while if third column is PCS000289
and first column should be greater than 3000, then replace PCS000289 by YES,
remaining the others column same.
... (1 Reply)
Discussion started by: cdfd123
1 Replies
3. UNIX for Dummies Questions & Answers
I have a space delimited text file. I want to extract rows where the third column has 0 as a value and write those rows into a new space delimited text file. How do I go about doing that? Thanks! (2 Replies)
Discussion started by: evelibertine
2 Replies
4. UNIX for Dummies Questions & Answers
I have a space delimited text file with two columns. I would like to add NA to the first column of the text file.
Input:
19625 10.4791768259
19700 10.8146489183
19701 10.9084026759
19702 10.9861346978
19703 10.9304364984
Output:
NA19625 10.4791768259
NA19700 10.8146489183... (1 Reply)
Discussion started by: evelibertine
1 Replies
5. Shell Programming and Scripting
Hi,
I am trying to move a column from one position to another position in a delimited file. The positions are dynamic in nature and are available by environmental variables. Also the file can have n number of columns.
Example:
Initial Column Position=1
Final Column Position=3
Delimiter='|'
... (2 Replies)
Discussion started by: ayan153
2 Replies
6. UNIX for Dummies Questions & Answers
How do I use awk to log transform the fifth column of a tab-delimited text file? Thanks! (1 Reply)
Discussion started by: evelibertine
1 Replies
7. UNIX for Dummies Questions & Answers
I want to add a new column to a tab delimited text file. It will be the first column and it will just be 1's. How do I go about doing that? Thanks! (1 Reply)
Discussion started by: evelibertine
1 Replies
8. UNIX for Dummies Questions & Answers
How do you delete cells from a space delimited text file given row and column number? Letś say the row number is r and the column number is c. Thanks! (5 Replies)
Discussion started by: evelibertine
5 Replies
9. Shell Programming and Scripting
Hi All
I wanted to know how to effectively delete some columns in a large tab delimited file.
I have a file that contains 5 columns and almost 100,000 rows
3456 f g t t
3456 g h
456 f h
4567 f g h z
345 f g
567 h j k lThis is a very large data file and tab delimited.
I need... (2 Replies)
Discussion started by: Lucky Ali
2 Replies
10. Shell Programming and Scripting
I have a large text-file with tab-delimited genetic data that looks like:
KSC112 KSC234 0 0 1 1 A G C T
I simply wan to delete the first column, but since the file has 600 000 columns, it is not possible with awk (seems to be limited at 32k columns).
Does anyone have an idea how to do this? (2 Replies)
Discussion started by: andmal
2 Replies