10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
I have a csv which has lot of columns . I was looking for an awk script which would extract a column twice. for the first occurance the header and data needs to be intact but for the second occurance i want to replace the header name since it a duplicate and extract year value which is in ddmmyy... (10 Replies)
Discussion started by: Kunalcurious
10 Replies
2. UNIX for Beginners Questions & Answers
Dear Community;
I need to join two files but I am facing issues.
1st file has multiple columns. Primary (1st) columns has unique values. There are other columns out of which some has non-ascii characters as well (other language).
Example File below:
1-1001JRL,BiRecurring... (5 Replies)
Discussion started by: mystition
5 Replies
3. Shell Programming and Scripting
I have a huge text file, about 52 GB. In the file, there are patterns like these:
]
]
]
]One can see that there is text within patterns such as and ], and I am only interested in ]. There is text before and after all these patterns too, for example,
''Anarchism''' is a ] that advocates ]... (3 Replies)
Discussion started by: shoaibjameel123
3 Replies
4. Shell Programming and Scripting
Hey guys,
I have a file that is delimited by | and I am trying to write a sed command to
convert this:
abc|def||ghi|jkl||||mnop
into this:
abc|def|-|ghi|jkl|-|-|-|mnop
The output I am getting out of:
sed -e "s/+//g" /tmp/opt.del > /tmp/opt2.del
is like:
... (9 Replies)
Discussion started by: prohank
9 Replies
5. Shell Programming and Scripting
Trying to print the unique values in $2 before the -, currently the count is displayed. Hopefully, the below is close. Thank you :).
file
chr2:46603668-46603902 EPAS1-902|gc=54.3 253.1
chr2:211471445-211471675 CPS1-1205|gc=48.3 264.7
chr19:15291762-15291983 NOTCH3-1003|gc=68.8 195.8... (3 Replies)
Discussion started by: cmccabe
3 Replies
6. Shell Programming and Scripting
I'm attempting to replace a substring that contains a hyphen and not having much success, can anyone point out where i'm going wrong or suggest an alternative.
# echo /var/lib/libvirt/images/vm888b-clone.qcow | sed -e 's|vm888-clone|qaz|g'
/var/lib/libvirt/images/vm888b-clone.qcow (1 Reply)
Discussion started by: squrcles
1 Replies
7. Shell Programming and Scripting
I want to check for more than one hyphen and then hold the first one and delete the rest of the hyphen.
I try something like this sed 's/\(*\)\1/\1/' but this doesn't work.
I try something like this sed 's/\(*\)-\1/ \1/g' but here the script delete all the hyphen.
I want to go from this : I... (2 Replies)
Discussion started by: thailand
2 Replies
8. UNIX Desktop Questions & Answers
Hi, I'm trying to do something relatively simple.
I have a txt file that has the following kinds of lines (and many more lines):
CP19 Oahu - Maunawili Falls
CP20 Oahu - Maunawili Falls
AG12 Oahu - Maunawili Falls
CP22 Oahu - Maunawili Falls, Local area
AG14 Oahu
CP141 KZ102 Kauai -... (7 Replies)
Discussion started by: euspilapteryx
7 Replies
9. Shell Programming and Scripting
Hello,
I really would appreciate some help with a bash script for some string manipulation on an SQL dump:
I'd like to be able to rename "sites/WHATEVER/files" to "sites/SOMETHINGELSE/files" within the sql dump.
This is quite easy with sed:
sed -e... (1 Reply)
Discussion started by: otrotipo
1 Replies
10. Shell Programming and Scripting
In one script i have seen - in #! line can somebody explain the meaning of -(hyphen) here
#! /bin/sh - (7 Replies)
Discussion started by: Dhruva
7 Replies