Dear Expert,
I want to import data from a folder having different txt/log files say 1.txt , 2.txt , 3.txt to one excel workbook having predefined sheets ,one for every .txt file by pressing one IMPORT tab.
Data imported from txt file should be based on key words.
Like in txt file there is one word date , this should be matched to perfectly one cell in excel sheet and so on.(plz refer below , data to be fetched is marked as yellow)
there is 2 lines of numeric data in txt file that should be imported in tabular form in excel after the word counter and date in the form
Same is to repeat for say 10 files .
please help me in coding for one txt file , i will try to do it for rest of the files.
I will be very grateful for ur help.
Regards,
Navin
txt file to be read is like this
MGWP102> pmx MgwApplication maxNrOfLicMediaStreamChannels -m 2
110201-09:34:58 10.200.67.60 8.0d MGW_NODE_MODEL_B_15_21 stopfile=/tmp/28134
.........................
gzip -dc /home/mtr/moshell_logfiles/logs_moshell/pmfiles/10.200.67.60/pm_data/A20110201.0200-0215.1.xml.gz /home/mtr/moshell_logfiles/logs_moshell/pmfiles/10.200.67.60/pm
_data/A20110201.0215-0230.1.xml.gz /home/mtr/moshell_logfiles/logs_moshell/pmfiles/10.200.67.60/pm_data/A20110201.0230-0245.1.xml.gz /home/mtr/moshell_logfiles/logs_moshe
ll/pmfiles/10.200.67.60/pm_data/A20110201.0245-0300.1.xml.gz /home/mtr/moshell_logfiles/logs_moshell/pmfiles/10.200.67.60/pm_data/A20110201.0300-0315.1.xml.gz /home/mtr/m
oshell_logfiles/logs_moshell/pmfiles/10.200.67.60/pm_data/A20110201.0315-0330.1.xml.gz /home/mtr/moshell_logfiles/logs_moshell/pmfiles/10.200.67.60/pm_data/A20110201.0330
-0345.1.xml.gz /home/mtr/moshell_logfiles/logs_moshell/pmfiles/10.200.67.60/pm_data/A20110201.0345-0400.1.xml.gz | /home/mtr/moshell//pmExtract -u "mgwapplication" "maxNr
OfLicMediaStreamChannels" | /home/mtr/moshell//pmXtab -cols time -fmt txt -m "(?:\w+=[^,]+,){1,2}((\w+=[^,]+,*)+$)"
Report from 2011-02-01 02:00 UTC to 2011-02-01 03:59 UTC
Date: 2011-02-01
Object Counter 02:00 02:15 02:30 02:45 03:00 03:15 03:30 03:45
MgwApplication=1 maxNrOfLicMediaStreamChannels 57744 57744 57744 57744 57744 57744 57744 57744
I want to import data from a folder having different txt/log files say 1.txt , 2.txt , 3.txt to one excel workbook having predefined sheets ,one for every .txt file by pressing one IMPORT tab.
Data imported from txt file should be based on key words.
Like in txt file there is one word date , this should be matched to perfectly one cell in excel sheet and so on.(plz refer below , data to be fetched is marked as yellow)
there is 2 lines of numeric data in txt file that should be imported in tabular form in excel after the word counter and date in the form
Same is to repeat for say 10 files .
please help me in coding for one txt file , i will try to do it for rest of the files.
I will be very grateful for ur help.
Regards,
Navin
txt file to be read is like this
MGWP102> pmx MgwApplication maxNrOfLicMediaStreamChannels -m 2
110201-09:34:58 10.200.67.60 8.0d MGW_NODE_MODEL_B_15_21 stopfile=/tmp/28134
.........................
gzip -dc /home/mtr/moshell_logfiles/logs_moshell/pmfiles/10.200.67.60/pm_data/A20110201.0200-0215.1.xml.gz /home/mtr/moshell_logfiles/logs_moshell/pmfiles/10.200.67.60/pm
_data/A20110201.0215-0230.1.xml.gz /home/mtr/moshell_logfiles/logs_moshell/pmfiles/10.200.67.60/pm_data/A20110201.0230-0245.1.xml.gz /home/mtr/moshell_logfiles/logs_moshe
ll/pmfiles/10.200.67.60/pm_data/A20110201.0245-0300.1.xml.gz /home/mtr/moshell_logfiles/logs_moshell/pmfiles/10.200.67.60/pm_data/A20110201.0300-0315.1.xml.gz /home/mtr/m
oshell_logfiles/logs_moshell/pmfiles/10.200.67.60/pm_data/A20110201.0315-0330.1.xml.gz /home/mtr/moshell_logfiles/logs_moshell/pmfiles/10.200.67.60/pm_data/A20110201.0330
-0345.1.xml.gz /home/mtr/moshell_logfiles/logs_moshell/pmfiles/10.200.67.60/pm_data/A20110201.0345-0400.1.xml.gz | /home/mtr/moshell//pmExtract -u "mgwapplication" "maxNr
OfLicMediaStreamChannels" | /home/mtr/moshell//pmXtab -cols time -fmt txt -m "(?:\w+=[^,]+,){1,2}((\w+=[^,]+,*)+$)"
Report from 2011-02-01 02:00 UTC to 2011-02-01 03:59 UTC
Date: 2011-02-01
Object Counter 02:00 02:15 02:30 02:45 03:00 03:15 03:30 03:45
MgwApplication=1 maxNrOfLicMediaStreamChannels 57744 57744 57744 57744 57744 57744 57744 57744