Good morning all. I have been running into a problem running a simple gawk script that selects every third line from an input file and writes it to an output file.
I am attempting to run this command from a batch file at the command line. I have several hundred files to perform this operation on and it would sure be handy to be able to just work up a quick batch file and let it fly.
The script works fine from the command line. Very slow though since I must do one file at a time and change the file name between each run. Tedious to say the least and I have been up all night now.
The problem that I am having appears to be related to the %3 qualifier in the script. When run from a batch file I do not get an error message. I get an empty file and the screen output at the command line shows the code interpreted as
I have tried backslashing the %, enclosing it in double-quotes, enclosing each character in double-quotes, double-quotes and double backslashes, etc. All the combinations that my tired mind could conjure. No joy.
I am beginning to think that gawk will not pass this particular character to the command line from a Windows batch file. I have looked around various forums, read the books that I have, and can find nothing to guide me.
I would be thrilled if someone had a solution to the problem of grabbing every third line from a file and dumping to text output. Perl or gawk preferred. Other options will be considered.
Thanks for looking. 10000Springs (BC)
You could try to escape the "%":
This User Gave Thanks to Franklin52 For This Post:
Hi all,
I'm working on Windows, connecting to my Unix account by different ways: by FTP opening files in UltraEdit32, by mapping drive to browse, by Exceed or Telnet to compile at Unix account. Actually, that is what I would like to change:
I'd like to make a batch file which would connect to... (7 Replies)
I am using awk in my .ksh script but when I am trying to run in windows
its not recognising awk part of the ksh script , even when I changed it to gawk it does not work, this is how my .ksh and .bat files look like.
thanx.
#!/bin/ksh
egrep -v "Rpt 038|PM$|Parameters:|Begin |Date: |End... (1 Reply)
Hi,
I would like to backup particular files from unix to windows for every day through ftp to my desktop. For that anyone tell me syntax for create batch file in windows.
Regards,
Arulkumar (0 Replies)
Hi everyone, let me get straight to the points.
My manager wants to execute a remote batch file (on a Windows server) from a UNIX Machine, does anyone know if this is possible and what packages would be needed?
Thanks
p.s. Sorry i cant give OS specifics, we use most UNIX's; AIX, Solaris,... (5 Replies)
Hi,
When I run the below script in UNIX it's throwing syntax errors. Actually it's a windows batch script. Could anyone change the below Windows Batch script to UNIX shell script...
Script:
REM :: File Name : Refresh_OTL.bat
REM :: Parameters : %1 - Region
REM :: : %2 - Cube Type
REM ::... (5 Replies)
Morning,
I'm trying to execute a vbs from a .bat file. Can someone tell me what the difference is between these statements:
start c:\lib\runit.vbc
c:\lib\runit.vbs
When I run the batch with the 'start' parameter it doesn't seem to do anything. (1 Reply)
I wish to create a folder on a unix server B from my windows box using windows batch script.
Below is my windows batch script.
@ ECHO OFF
::Enter your Directory name:
echo Enter your Directory name:
set /p mydir=
plink user1@ServerA
mkdir %mydir%
At plink command i get logged... (7 Replies)
Hi all,
i need to run a shell script on remote server. I have created file .bat file in windows server with following code,
c:\Users\Desktop\putty.exe -ssh -pw password user@server ./script.sh
i need to run the script.sh in my remote server
Above command is not working, any... (4 Replies)
Hi everyone,
I've below windows batch script which is used to filter the file contents line by line and assign the matched values to the variables in for loop.
for /F "tokens=1,3 delims=:" %%A in (%LOG_DIR%\PM_IS_workflow_status.log) do (
set "ATTR_NAME=%%A"
if /i "!ATTR_NAME!" EQU "Folder"... (1 Reply)
Discussion started by: Kathraji
1 Replies
LEARN ABOUT SUSE
sabcmd
sabcmd(1) General Commands Manual sabcmd(1)NAME
sabcmd - a command line interface to Sablotron XSLT processor
SYNOPSIS
sabcmd [options] <stylesheet> [<input> [<output>]] [assignments]
sabcmd [options] -batch-xml <input> [<stylesheet> [<output>]]+ [assignments]
sabcmd [options] -batch-xsl <stylesheet> [<input> [<output>]]+ [assignments]
DESCRIPTION
sabcmd is a command line interface to Sablotron XSLT processor. You can use is to transform XML files with XSLT stylesheets.
The only required parameter is a stylesheet; this is a URI of an XSLT stylesheet to be used for the transformation process. If you omit an
input file, the standard input is used. In addition, you can specify an output file. If no output file is given, the output is sent to the
standard output.
sabcmd can also run in a batch mode to process single input file with multiple stylesheets (--batch-xml) or to apply a stylesheet to multi-
ple input files (--batch-xsl).
Assignments allow to pass parameters and named buffers to the processor. The assignments have always the form of
name1=value1 name2=value2 ...
where name is either an ASCII string for named buffers or an ASCII string with the leading '$' sign for parameters. (Note that you need to
use the right quotes to prevent the shell interpreter from performing an expansion of variables).
OPTIONS
Option can be of two forms - short or long. If some options have values, the values are separated with a whitespace for short options and
with a equal sign ('=') for long options.
-L mylog.log
is the same as
--log-file=mylog.log
COMMON OPTIONS
-x, --batch-xml
multiple stylesheets, single input file
-s, --batch-xsl
multiple input files, single stylesheet
-b, --base=NAME
set the hard base URI to NAME
--debug-options
display the information on debugging options
-?, --help
display this help message
-L, --log-file=NAME
set the log file, turns logging on
-m, --measure
measure the time of processing
-v, --version
display the version information
DEBUG OPTIONS
--debug
display results of the command line parse
-t, --times=COUNT
run sabcmd the specified number of times
-f, --flags
pass flags given to SablotSetOptions()
-F, --use-SPF
use SablotProcessFiles()
-S, --use-SPS
use SablotProcessStrings(). Give 2 args (stylesheet, input). Precede each by @.
--use-SPS-on-files
use SablotProcessStrings() on the contents of the given files.
ENVIRONMENT
When the <xsl:sort> instruction is used without the 'lang' attribute, common locale related environment variables apply..
BUGS
There are no known bugs related to sabcmd currently. Most of bugs you can meet are related to Sablotron processor itself. In such a case,
please take a look at Sablotron's home website (www.gingerall.org) or contact us at <sab-bugs@gingerall.cz>.
AUTHOR
Pavel Hlavnicka <pavel@gingerall.cz>
June 17, 2002 sabcmd(1)