10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have an input file with
A=xyz
B=pqr
I would want the value in Second Field (xyz or pqr) updated with a value present in Shell Variable based on the value passed in the first field. (A or B )
while read line
do
NEW_VALUE = `some functionality done on $line`
If $line=First Field-... (1 Reply)
Discussion started by: infernalhell
1 Replies
2. Shell Programming and Scripting
Hi Folks,
I have a file with fields as follows which has last field in multiple lines. I would like to combine a line which has three fields with single field line for as shown in expected output. Please help.
INPUT
hname01 windows appnamec1eda_p1, ... (5 Replies)
Discussion started by: shunya
5 Replies
3. Shell Programming and Scripting
I am trying to remove lines in the target.txt file if $5 before the - in that file matches sorted_list. I have tried grep and awk. Thank you :).
grep
grep -v -F -f targets.bed sort_list
grep -vFf sort_list targets
awk
awk -F, '
> FILENAME == ARGV {to_remove=1; next}
> ! ($5 in... (2 Replies)
Discussion started by: cmccabe
2 Replies
4. UNIX for Advanced & Expert Users
Hi,
I have a requirement where I need to combine two lines in a file based on first character of each line in a file.
Please find the sample content of the file below:
Code:
_______________________
5, jaya, male, 4-5-90, single
smart
6, prakash, male, 5-4-84, married
fair
7, raghavi,... (1 Reply)
Discussion started by: jayaP
1 Replies
5. UNIX for Dummies Questions & Answers
Hi,
I have a requirement where I need to combine two lines in a file based on first character of each line in a file.
Please find the sample content of the file below:
Code:
_______________________
5, jaya, male, 4-5-90, single
smart
6, prakash, male, 5-4-84, married
fair
7, raghavi,... (1 Reply)
Discussion started by: jayaP
1 Replies
6. Shell Programming and Scripting
If a file has following kind of data, comma delimited
1,2,3,4
1
1
1,2,3,4
1,2
2
2,3,4
My required output must have only 4 columns with comma delimited
1,2,3,4
111,2,3,4
1,222,3,4
I have tried many awk command using ORS="" but couldnt progress (10 Replies)
Discussion started by: mdkm
10 Replies
7. Shell Programming and Scripting
Hi All,
I'm having a hard time finding a starting point for my issue. I have a 30k line file (fspsec.txt) that I would like to parse into smaller files based on any character existing in field 1.
ACCOUNTANT LEVEL 1 (ACCT.ACCOUNTANT)
OPERATORS: DOEJO (418)
TOOLS: Branch Maintenance
... (2 Replies)
Discussion started by: aahlrich
2 Replies
8. Shell Programming and Scripting
I can't decide if I should use AWK or PERL after pouring over these forums for hours today I decided I'd post something and see if I couldn't get some advice.
I've got a text file full of hundreds of events in this format:
Record Number : 1
Records in Seq : ... (3 Replies)
Discussion started by: Mayday22
3 Replies
9. Shell Programming and Scripting
Hi,
I've one requirement. I have to split one comma delimited file into multiple files based on one of the column values.
How can I achieve this Unix
Here is the sample data. In this case I have split the files based on date column(c4)
Input file
c1,c2,c3,c4,c5... (1 Reply)
Discussion started by: manasvi24
1 Replies
10. Shell Programming and Scripting
hello
I have a number of lines that need to be added at the end of a file each time I add a field in another file (let's name it file2)
file2 has this format:
filed1:field2:path1:path2:path3:path...
Whenever I add a path field, I should add to file1 these lines:
<Location path1>... (0 Replies)
Discussion started by: melanie_pfefer
0 Replies