Search Results

Search: Posts Made By: spirospap
2,676
Posted By Don Cragun
I am perfectly aware that this is the "UNIX for...
I am perfectly aware that this is the "UNIX for Dummies Questions & Answers" forum. (It is not the "UNIX for Dummies Get Free Code Here" forum.) We are here to help you learn how to use UNIX and...
2,676
Posted By Don Cragun
Instead of searching the web for explicit ways to...
Instead of searching the web for explicit ways to perform very particular formatting requests, try reading the awk man page on your system and see if you can figure out how to modify the scripts you...
2,676
Posted By Don Cragun
If you haven't already figured it out, to ignore...
If you haven't already figured it out, to ignore empty lines in your input files, insert three more lines in the awk script I suggested:
NF == 0 {
next
}
just before the line:
FNR == NR {
2,676
Posted By RudiC
Could it be there's a trailing extra empty line...
Could it be there's a trailing extra empty line in your input file(s)? Then $1, $2, and $9 are empty, and it prints jdb, nothing, "-"...
2,676
Posted By Don Cragun
Try: #!/bin/ksh for file in...
Try:
#!/bin/ksh
for file in [A-Z][A-Z][A-Z][0-9][0-9][0-9][0-9]0[01][0-9]
do m=${file#????????}
y=${file#???}
y=${y%???}
jd1=$(printf '%(%j)T' "$m/01/$y")
printf '%s,%s\n' "$file" "$jd1"...
2,676
Posted By Don Cragun
Making some wild guesses about what you really...
Making some wild guesses about what you really want on the 1st three lines in each of your output files (.e., all of the data with <comma>s changed to <space>s instead of throwing away the call...
2,644
Posted By MadeInGermany
On my Unix and Linux boxes it works: $ \ls -1 ...
On my Unix and Linux boxes it works:
$ \ls -1
xxxr.hdr
xxxx.tar
xxxx.tif
xxxx.txt
xxxxr
xxxxt
$ find . -type f \( -name "*[rt]" \! -name "*.*" -o -name "*[rt].hdr" \) -exec echo {} +
./xxxxt...
3,924
Posted By RudiC
Given all the files to be moved are at least one...
Given all the files to be moved are at least one char longer than the directories, as in your sample, try while read FN; do mv -v ${FN}?* $FN; done < namesUC.txt
‘LC80140322014219LGN00_B1.TIF’ ->...
3,924
Posted By Don Cragun
If you don't want to go to the bother of creating...
If you don't want to go to the bother of creating namesUC.txt you could also let the script process all regular files in the directory with names that start with the same name as a directory in that...
3,924
Posted By RudiC
This would create the needed directories: ls LC*...
This would create the needed directories: ls LC* | cut -c 1-21 | sort -u | xargs mkdir -p

The -p option to mkdir avoids errors if dirs already exists. No reasonable error checking is done.
Showing results 1 to 10 of 10

 
All times are GMT -4. The time now is 02:36 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy