Sponsored Content
Top Forums Programming Shell script - to see if any change from last csv Post 302991795 by robertkwild on Friday 17th of February 2017 04:20:21 AM
Old 02-17-2017
i will give you the code to the Imacros -

Code:
VERSION BUILD=10.3.27.5830
TAB T=1
URL GOTO=http://172.17.4.52/
FRAME NAME=theHeader
TAG POS=1 TYPE=A ATTR=TXT:Properties
FRAME NAME=theBottom
TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:/userpost/xerox.set ATTR=NAME:webUsername CONTENT=admin
SET !ENCRYPTION NO
TAG POS=1 TYPE=INPUT:PASSWORD FORM=ACTION:/userpost/xerox.set ATTR=NAME:webPassword CONTENT=password
TAG POS=1 TYPE=BUTTON:SUBMIT FORM=ACTION:/userpost/xerox.set ATTR=TXT:Login
FRAME NAME=theTree
TAG POS=1 TYPE=A ATTR=TXT:Login/<SP>Permissions/<SP>Accounting
TAG POS=1 TYPE=A ATTR=TXT:Accounting<SP>Methods
FRAME NAME=theContent
TAG POS=1 TYPE=BUTTON ATTR=TXT:Report<SP>and<SP>Reset
TAG POS=2 TYPE=INPUT:RADIO FORM=ACTION:# ATTR=NAME:frmusageReportList CONTENT=YES
ONDOWNLOAD FOLDER=Z:\printers\accounts\ FILE={{!NOW:dd-mm-yyyy}}_XSAreport.csv WAIT=YES
TAG POS=1 TYPE=BUTTON FORM=ACTION:# ATTR=TXT:Download<SP>Report<SP>(.csv)
WAIT SECONDS=10

and i run this batch script everynight using task scheduler -

Code:
"C:\Program Files\Ipswitch\iMacros\iMacros.Sidebar.exe" -macro "C:\ie_imacro\iMacros\Macros\accounts.iim"

so what the batch file does is that it runs the imacro program for the accounts printer

it saves the file in the location "Z:\printers\accounts\ FILE={{!NOW:dd-mm-yyyy}}_XSAreport.csv"

it runs 24/7 and produces csv reports for all the days (the attachment i showed you)

all this runs on a windows 7 machine

now i want to extract the csv data in specific columns D, E, F and the whole of column A as column A is showing the clients/customers names

am i making any sense?

sorry if im not

---------- Post updated at 11:20 AM ---------- Previous update was at 10:42 AM ----------

im getting somewhere -

Code:
awk -F"," '{print $1,$4,$5,$6}' 16-02-2017_XSAreport.csv

---------- Post updated 02-17-17 at 04:20 AM ---------- Previous update was 02-16-17 at 11:20 AM ----------

Code:
awk -F',' 'NR>3 {print $1,$4,$5,$6}' 16-02-2017_XSAreport.csv

 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Modifying a csv file from Shell Script

Hi all, I have some script that creates a temp csv file. What I need to do is do some search and replace and modify the file from my shell script. I know the commands to open the file and then apply the reg ex but wasnt sure how I could do this from a script and modify the file? Any help... (2 Replies)
Discussion started by: not4google
2 Replies

2. UNIX for Advanced & Expert Users

shell script to format .CSV data

Hi all, I have written a shell script to search a specified directory (e.g. /home/user) for a list of specific words (shown as ${TMPDIR}/wordlist below). The script works well enough, but I was wondering if there was a way to display the line number that the word is found on? Thanks! cat... (1 Reply)
Discussion started by: tmcmurtr
1 Replies

3. Shell Programming and Scripting

how to create csv file using shell script

I have a file in multiple directory which has some records in the following format File: a/latest.txt , b/latest.txt, c/latest.txt -> Name=Jhon Age=27 Gender=M Street=LA Road Occupation=Service I want to generate a csv file from the above file as follows File: output.csv -> ... (9 Replies)
Discussion started by: rjk2504
9 Replies

4. Shell Programming and Scripting

Shell script for CSV conversion

thanks for allowing me join your forum i have an output of linux command "who" which provides following details..... CURRENT USER/ACCT INFO 17:31:36 up 4:49, 4 users, load average: 0.03, 0.04, 0.00 USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT root :0 - 12:59 ?xdm? 4:54 0.02s /bin/sh /usr/bi... (1 Reply)
Discussion started by: ayyappancheta
1 Replies

5. UNIX for Dummies Questions & Answers

Help to parse csv file with shell script

Hello ! I am very aware that this is not the first time this question is asked here, because I have already read a lot of previous answers, but none of them worked, so... As said in the title, I want to read a csv file with a bash script. Here is a sample of the file: ... (4 Replies)
Discussion started by: Grhyll
4 Replies

6. Shell Programming and Scripting

Shell script to csv

I am preparing script and trying to send output into CSV format. there is property called RNAME when it is blank, next propery(XMIT) is coming into RNAME propery. So i want whenever RNAME is blank it should put "," in that field. So that all will fit in proper coloums in csv file. Can you please... (8 Replies)
Discussion started by: darling
8 Replies

7. Shell Programming and Scripting

Reading a csv file using shell script

Hello All, I have a csv file that looks like below ProdId_A,3.3.3,some text,some/text,sometext_1.2.3 ProdId_B,3.3.3,some text,some/text,sometext_1.2.3 ProdId_C,3.3.3,some text,some/text,sometext_1.2.3 ProdId_A,6.6.6,some text,some/text,sometext_9.9.9 I will get ProdId from... (5 Replies)
Discussion started by: anand.shah
5 Replies

8. Shell Programming and Scripting

CSV File Creation Within Shell Script

Hi All, I am trying to create a CSV file within a shell script test.ksh and the code snippet is something like below: #!/usr/bin/ksh # Set required variables. . $HOME/.prof # Output file path Group1=/tmp/G1.csv Group2=/tmp/G2.csv Group3=/tmp/G3.csv $ORACLE_HOME/bin/sqlplus -s... (2 Replies)
Discussion started by: swasid
2 Replies

9. UNIX for Beginners Questions & Answers

Shell script to fetch values in csv

I need to fetch below values from this file. (1 Reply)
Discussion started by: nit42
1 Replies
IPC::SysV(3pm)						 Perl Programmers Reference Guide					    IPC::SysV(3pm)

NAME
IPC::SysV - System V IPC constants and system calls SYNOPSIS
use IPC::SysV qw(IPC_STAT IPC_PRIVATE); DESCRIPTION
"IPC::SysV" defines and conditionally exports all the constants defined in your system include files which are needed by the SysV IPC calls. Common ones include IPC_CREATE IPC_EXCL IPC_NOWAIT IPC_PRIVATE IPC_RMID IPC_SET IPC_STAT GETVAL SETVAL GETPID GETNCNT GETZCNT GETALL SETALL SEM_A SEM_R SEM_UNDO SHM_RDONLY SHM_RND SHMLBA and auxiliary ones S_IRUSR S_IWUSR S_IRWXU S_IRGRP S_IWGRP S_IRWXG S_IROTH S_IWOTH S_IRWXO but your system might have more. ftok( PATH ) ftok( PATH, ID ) Return a key based on PATH and ID, which can be used as a key for "msgget", "semget" and "shmget". See ftok. If ID is omitted, it defaults to 1. If a single character is given for ID, the numeric value of that character is used. shmat( ID, ADDR, FLAG ) Attach the shared memory segment identified by ID to the address space of the calling process. See shmat. ADDR should be "undef" unless you really know what you're doing. shmdt( ADDR ) Detach the shared memory segment located at the address specified by ADDR from the address space of the calling process. See shmdt. memread( ADDR, VAR, POS, SIZE ) Reads SIZE bytes from a memory segment at ADDR starting at position POS. VAR must be a variable that will hold the data read. Returns true if successful, or false if there is an error. memread() taints the variable. memwrite( ADDR, STRING, POS, SIZE ) Writes SIZE bytes from STRING to a memory segment at ADDR starting at position POS. If STRING is too long, only SIZE bytes are used; if STRING is too short, nulls are written to fill out SIZE bytes. Returns true if successful, or false if there is an error. SEE ALSO
IPC::Msg, IPC::Semaphore, IPC::SharedMem, ftok, shmat, shmdt AUTHORS
Graham Barr <gbarr@pobox.com>, Jarkko Hietaniemi <jhi@iki.fi>, Marcus Holland-Moritz <mhx@cpan.org> COPYRIGHT
Version 2.x, Copyright (C) 2007, Marcus Holland-Moritz. Version 1.x, Copyright (c) 1997, Graham Barr. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.12.1 2010-04-26 IPC::SysV(3pm)
All times are GMT -4. The time now is 04:23 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy