Search Results

Search: Posts Made By: galaxy_rocky
19,734
Posted By RudiC
awk -F';' '"ASD"==$13 {print > "ASD.txt";next}1'...
awk -F';' '"ASD"==$13 {print > "ASD.txt";next}1' input_file >other.txt
19,734
Posted By RavinderSingh13
Hello, Here is one more approach by reading...
Hello,

Here is one more approach by reading the files 2 times. Let us say we have input filename whose name is test7.


awk -F";" 'NR==FNR{a["ASD"]=$0;next} ($13 in a){print $0 >>...
19,734
Posted By junior-helper
With field 13 being the last field at the same...
With field 13 being the last field at the same time, this approach may be sufficient:
$ grep -E 'ASD;$' in > out.asd
$ grep -vE 'ASD;$' in > out.other
19,734
Posted By SriniShoo
awk -F ';' '$13 == "ASD" {print > ("ASD.txt");...
awk -F ';' '$13 == "ASD" {print > ("ASD.txt"); next} {print > ("REST.txt")}' input_file
5,740
Posted By ygemici
Did you try Carlom's solution or try this.....
Did you try Carlom's solution
or try this.. good lucks
awk -F';' 'BEGIN{print "<Row>"}{for(i=1;i<=NF;)print "<Cell><Data ss:Type=\"String\">"$(i++)"</Data></Cell>"}
END{print...
5,740
Posted By CarloM
If every field is treated the same then you can...
If every field is treated the same then you can do the Cell tags fairly simply in one awk command. Something like:
echo "$line" | awk -F';' '{ for (i=1;i<NF;i++) { print "<Cell><Data...
1,779
Posted By Akshay Hegde
If awk is fine for you try this $ awk -F...
If awk is fine for you try this
$ awk -F 'timestamp="' 'NF>1{s=$2;sub(/".*/,"",s);sub(s,strftime("%d-%h-%Y %H:%M:%S",s/1000))}1' file

<logEvent xsi:type="logservice:LogEvent" ...
1,779
Posted By bartus11
Try:perl -slpe 'use...
Try:perl -slpe 'use POSIX;/(timestamp=")([^"]+)/;$ts=strftime "$fmt", gmtime $2/1000;s/(timestamp=")([^"]+)/$1$ts/' -- -fmt="%Y-%m-%d %H:%M" file.xmlReplace the format at the end of that command with...
1,490
Posted By Scrutinizer
It seems to me there are 3 digits too many,...
It seems to me there are 3 digits too many, probably it is Epoch in milliseconds:
$ date -d @1394713811.052
Thu Mar 13 13:30:11 CET 2014

dd=1394713811052
date -d "@$(echo "$dd/1000"|bc)"
5,960
Posted By Corona688
That code is rather redundant, this would do: ...
That code is rather redundant, this would do:

ssh username@host '[ -f "directory/structure/Daily Report.xls" ]'
file_avail=$?
5,960
Posted By Klashxx
ok , use: file_avail=`ssh username@host 'if [[...
ok , use:
file_avail=`ssh username@host 'if [[ -f "directory/structure/Daily Report.xls" ]]; then echo 1; else echo 0; fi'`
Personally , i prefer:
ssh username@host 'if [[ -f "Daily Report.xls"...
Showing results 1 to 11 of 11

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