10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
on linux systems, i can do something like this:
$ JIOO=hello.one.two
$
$ awk -F"." '{print $2}' <<< "${JIOO}"
however, on older systems or other unix systems that dont have the fancy stuff this does not work.
i contemplated using "-v var="${JIOO}" but i dont think that works.
any... (7 Replies)
Discussion started by: SkySmart
7 Replies
2. UNIX for Dummies Questions & Answers
Hi there
I have the variable command below in a script to list the file name in a directory:FILEN="$(ls <PATH> | awk '{print $1}')".
When it is run, it correctly returns the following:. I would like to be able to cut the date/time portion of the filename and store it as a variable for later... (4 Replies)
Discussion started by: jimbojames
4 Replies
3. Shell Programming and Scripting
I can got the filename with this script. it's only show "-" in result.
cut -d , -f7 CSV_d.* | awk 'OFS=":"{print FILENAME,substr($1,1,8),substr($1,9,2),substr($1,11,2),substr($1,13,2)}' | sort |uniq (2 Replies)
Discussion started by: before4
2 Replies
4. UNIX for Dummies Questions & Answers
My file looks something like this:
infile.seq
I need to include the filename in each identifier, without the extension, and number them with consecutive numbers starting with 1. So, the expected outfile should look like this:
I have been trying to modify the following code but I... (5 Replies)
Discussion started by: Xterra
5 Replies
5. Shell Programming and Scripting
Hi,
i have files which contains list of csv file names
say temp.txt contains below like data
Dns_bangalore_08172011.093033.1139.csv
Dns_bangalore_08172011.093133.1139.csv
now i want to insert some string before .csv in the filename
say i want to insert string _sim1 beofre .csv... (3 Replies)
Discussion started by: raghavendra.nsn
3 Replies
6. Shell Programming and Scripting
i need to use awk to replace string in file.
if suppose filename is abcd.dat i need to replace in file
california with CA
else
if file name name is cdef.dat i need to replace in file
california with CALI
i need to use awk(must)
any suggestion how can i do that
file structure
... (3 Replies)
Discussion started by: er_zeeshan05
3 Replies
7. UNIX for Dummies Questions & Answers
I have created a nawk program and passing a file as an input parameter.
The filename will be /home/dir/ksh/test.out
I need to extract the filename alone. Is there anyway to get this ?
Input : /home/dir/ksh/test.out
Output -1: test.out
Output -2 : t
Input :... (1 Reply)
Discussion started by: sivakumar.rj
1 Replies
8. Shell Programming and Scripting
I am trying to write a script that prompts users for date and time, then process the gzip file into awk. During the ksh part of the script another file is created and needs to be processed with a different set of pattern matches then I need to combine the two in the end. I'm stuck at the part... (6 Replies)
Discussion started by: timj123
6 Replies
9. Shell Programming and Scripting
Hi
The following code seems to work, but why am i getting an error message?
cscyabl@comet:(develop)> awk 'BEGIN {FS="|"}{print $2 >> $1}' test.sum
awk: A print or getline function must have a file name.
The input line number is 8. The file is test.sum.
The source line number is 1.
... (2 Replies)
Discussion started by: Indalecio
2 Replies
10. UNIX for Dummies Questions & Answers
Need some help.
I need to load data into some Oracle tables and one of the pieces of data that I need to load is the filename. This filename is distinct every single time. Basically the last 6 characters will be different with no pattern.
ex. testfile_041504_003567
To load the filename... (4 Replies)
Discussion started by: firkus
4 Replies