10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
I would like to insert n number of characters at the beginning of each line that starts with a given character. If possible, I would be most appreciative for a sed or awk solution.
Given the data below, I would like to be able to insert either 125 spaces or 125 "-" at the beginning of every line... (6 Replies)
Discussion started by: jvoot
6 Replies
2. Shell Programming and Scripting
Want to get the remaining line after pattern match Here it starts - executed commands : - pattern to identify 100:27:500:1:34:END
Required output:100:27:500:1:34:END
awk '{if(/pattern to identify/) print $2}' < file
I have used above code and it not giving... (3 Replies)
Discussion started by: rozee
3 Replies
3. Shell Programming and Scripting
Hi All,
I have a file testarun.txt contains the below lines and i want to print the lines if the character positions 7-8 matches 01.
201401011111
201401022222
201402013333
201402024444
201403015555
201403026666
201404017777
201404028888
201405019999
201405020000
I am trying the... (4 Replies)
Discussion started by: Arunprasad
4 Replies
4. Shell Programming and Scripting
Hi
I have a file like this:
Peter North
Mary
Peter North
Peter Borough
Mary
I need there to put 'X' (or anything) on a new line between the two lines where 'Peter' begins the line. There will be many matches to this string, but they will always begin with 'Peter'.
Ie, the resulting... (2 Replies)
Discussion started by: majormajormajor
2 Replies
5. Shell Programming and Scripting
Hi,
How to delete the last line if is match the below string else no action...
String checking "END OF FILE. ROW COUNT: "
9f680174-cb87-4f71-887a-93b6f62fa5aa|20077337254|2
9f680174-cb87-4f71-887a-93b6f62fa5aa|20077337254|0
229f680174-cb87-4f71-887a-93b6f62fa5aa|20077337254|3
END OF... (2 Replies)
Discussion started by: bmk
2 Replies
6. Shell Programming and Scripting
Hi experts,
My csv file looks like this
U;cake;michael;temp;;;;
U;bread;john;temp;;;;
U;cocktails;sarah;temp;;;;
I'd like to change the value fo 2nd column to cf+random number , which will look maybe something like this
U;cf20187;michael;temp;;;;
U;cf8926;john;temp;;;;... (7 Replies)
Discussion started by: tententen
7 Replies
7. Shell Programming and Scripting
Hi
Need your help to assign the string to a variable from a line which has no fixed delimter in unix.
for example , my file contains
Name="report""
File Name one="test1"
File Name two="test2"
now how do I read report , test1 and test2 ?
var1=report
var2=test1
var3=test2
... (1 Reply)
Discussion started by: rashmisb
1 Replies
8. Shell Programming and Scripting
Source File:
abcdefghijklmnop01qrstuvwxyz
abcdefghijklmnop02qrstuvwxyz
abcdefghijklmnop03qrstuvwxyz
abcdefghijklmnop04qrstuvwxyz
abcdefghijklmnop05qrstuvwxyz
Whatever characters are in 17-18 on each line of the file, it should be concatenated to the same line at the character number... (6 Replies)
Discussion started by: tamahomekarasu
6 Replies
9. Shell Programming and Scripting
Hi
I am trying to fetch the rows with match string "0000001234"
Input file looks like below:
09 0 XXX 0000001234 Z 1
09 0 XXX 0000001234 Z 1
09 0 XXX 0000001234 Z 1
09 0 XXX 0000001234 Z 1
09 0 XXX 0000001234 Z 1... (6 Replies)
Discussion started by: nareshk
6 Replies
10. Shell Programming and Scripting
Hi All,
I'm new to unix shell scripting.. Could someone guide me.
I have to search a string in the entire directory, once the search string is matched, it should print the line number of the string that matches and also the line and along with
it, it should print the file name.
Thanks,... (5 Replies)
Discussion started by: thenz
5 Replies