Python script to run multiple command and append data in output csv file
Experts,
I am writing a script and able to write only small piece of code and not able to collect logic to complete this task.
In input file have to look for name like like this (BGL_HSR_901_1AG_A_CR9KTR10) before sh iss neors. Record this (BGL_HSR_901_1AG_A_CR9KTR10) in csv file
Now have to grep field with names like(BGL_MWN_901_1AC_T_CR9R1) line above IS-extended, pick one of it suppose(BGL_RGN_901_1AC_T_CR9R5) also record this in output csv file.
Now from the next two Is-extended grep field (BGL_CCG_901_1AG_CR9R13.00) also record it in csv file and BGL_CCG_902_1AC_CR9R5 already taken so have to skip it.
Now from next two Is-extended grep field (BGL_CCG_902_1AC_CR9R14) also record it in csv file and BGL_CCG_902_1AC_CR9R13 already taken so have to skip it.
Now from next two Is-extended grep field (BGL_CCG_902_1AC_CR9KT04.00) also record it in csv file and BGL_CCG_902_1AC_CR9R14 already taken so have to skip it. Here we have to stop search when we have find field having "9K" in it and create row like below as in output file
Now again pick another value/field from line above IS-extended, record it in output file and repeat the same process and build another row in output file
Now, In line IS-extended field (BGL_CCG_901_1AG_CR9K41) have 9K in it. so have to pick it and record in csv file and stop search
Now again pick another value/field from line above IS-extended and repeat the same process and build another row in output file
Hi Experts,
I am writing a python script to grep string from file and display output in csv file as in attached screenshot
https://drive.google.com/file/d/1gfUUdfmQma33tz65NskThYDhkZUGQO0H/view
Input file(result_EPFT_config_device)
Below is the python script i have prepared as of... (1 Reply)
I am not too savvy with arrays and am assuming that what I am looking for needs arrays. This is my requirement.
So I have the raw data that gets updated to a log as shown below
StudentInfo:
FullInfo = {
Address = Newark
Age = 20
Name= John
}
StudentInfo:... (2 Replies)
Hello gurus,
I have a csv file with bunch of datas in each column. (see attached)
Now I have an .xml file in the structure of below:
?xml version="1.0" ?>
<component id="root" name="root">
<component id="system" name="system">
<param name="number_of_A" value="8"/>
... (5 Replies)
I have 2 files generated in linux that has common output and were produced across multiple hosts with the same setup/configs. These files do some simple reporting on resource allocation and user sessions. So, essentially, say, 10 hosts, with the same (2) system reporting in the files, so a... (0 Replies)
Hi..Can anyone suggest a simple way of achieving this. I have several files which ends with extension .vcf . I will give example with two files
In the below files, we are interested in
File 1:
38 107 C 3 T 6 C/T
38 241 C 4 T 5 C/T
38 247 T 4 C 5 T/C
38 259 T 3 C 6 T/C... (8 Replies)
Hi All
I will run the same script every day in corn and output should go to same CSV file but in different row with dates on it. Below is my example in attached format.
Script i am using to collect switch port online
DATE=`date '+%d-%m-%y'`
for f in `cat... (1 Reply)
Hi all,
I am trying to create a shell script from solaris 10 server to run a command into multiple specific value in one file. The command is related to Oracle/Sun JES2005Q4 directory server.
#this is the command,
#from path /jes/ds/slapd-rldap1
./ns-inactivate.pl -h mldap1 -p 389 -D... (12 Replies)
Hello
I am trying to run a python program using shell script, which takes a single argument from a file.
This file has one entry per line :
1aaa
2bbb
3ccc
4ddd
5eee
...
...
...
My shell script runs the program, only for the last entry :
#!/bin/sh
IFS=$'\n'
for line in $(cat... (2 Replies)
I have a script which has to be scheduled to run 3 times a day.
My script picks the required fields from logfile and stores the data in a.csv file.
Sample data.
my logfile contain:
0097A,0374D,100903,1519,00000606191
0097A,C88RA,100903,0724,00000606105
So the output of first execution... (3 Replies)
I have an issue where I need to append a value at the last of the csv, I have created a shell script and it is appending the columns at the last but it is appending at all lines, and my requirement is specific to just append at the 1st line.
Have a look and suggest, (7 Replies)