10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
My file has data that looks like below:
more data.txt
I wish to display each string seperated by a delimiter :
Expected output:
I tried the below but I m not getting every split string on a new line.
#!/bin/bash
for i in `sed 's/:/\\n/g' data.txt`;
do
echo -n... (2 Replies)
Discussion started by: mohtashims
2 Replies
2. Shell Programming and Scripting
Hi,
Extremely new to Perl scripting, but need a quick fix without using TEXT::CSV
I need to read in a file, pass any delimiter as an argument, and convert it to bar delimited on the output. In addition, enclose fields within double quotes in case of any embedded delimiters.
Any help would... (2 Replies)
Discussion started by: JPB1977
2 Replies
3. Shell Programming and Scripting
Hi,
I have a No Delimiter variable length text file with following schema -
Column Name Data length
Firstname 5
Lastname 5
age 3
phoneno1 10
phoneno2 10
phoneno3 10
sample data - ... (16 Replies)
Discussion started by: Gaurav Martha
16 Replies
4. Shell Programming and Scripting
Hi all,
I have a number of strings like below:
//mnt/autocor/43°13'(33")W/
and i'm trying to get the numbers in this string, for example
431333
please help
thanks ahead (14 Replies)
Discussion started by: sunnydanniel
14 Replies
5. Shell Programming and Scripting
Hi,
while ; do
echo "Please enter "
read enter
yyyy=${enter:0:4}
mm=${enter:5:2}
dd=${enter:8:2}
result=`validateDate $yyyy $mm $dd`
When does the loop keeping repeating till?? till 1 is equal to 1?
what does this mean "${enter:0:4}" .The 0 and 4 part??
... (3 Replies)
Discussion started by: sid22
3 Replies
6. Shell Programming and Scripting
Given the scenario like this, if at all if have to use IFS on the below given example, how it should be used.
IFS=/
eg:
/xyz/123/348/file1
I want to use the last slash /file1 . So can anyone, suggest me how to pick the last "/" as a IFS. (4 Replies)
Discussion started by: raghunsi
4 Replies
7. Shell Programming and Scripting
Hi,
I have a string like ABC.123.XYZ-A1-B2-P1-C4. I want to delimit the string based on "-" and then get result as only two strings. One with string till last hyphen and other with value after last hyphen... For this case, it would be something like first string as "ABC.123.XYZ-A1-B2-P1" and... (6 Replies)
Discussion started by: gupt_ash
6 Replies
8. Shell Programming and Scripting
im messing up somehwere...and can't seem to clean up the script...for it to work
objectives:
1. check for today's file, and sleep 30 secs between retries
2. only allow 5 tries before script should fail.
3. if today's file found, wait 30 seconds for it to process..
code:
count=0... (8 Replies)
Discussion started by: sigh2010
8 Replies
9. Shell Programming and Scripting
Hi,
I have a for loop which iterates over a list of strings, separated by whitespace:
$ list="1 2 3"
$ for i in $list; do echo $i; done
1
2
3
I now want to introduce some strings containing whitespace themselves ... This is straightforward if I directly iterate over the list:
$ for... (4 Replies)
Discussion started by: kkkoehne
4 Replies
10. Shell Programming and Scripting
hi i am a learner
can some explain "export IFS=$(echo "\n\t\a")"
i am not able to understand the functionality
please help
thanks
Satya (1 Reply)
Discussion started by: Satyak
1 Replies