Jun 05
Mark Romano Executing Terminal Commands
Jun 05, 2017; 12:20
Mark Romano
Executing Terminal Commands
I have an OS X terminal command that takes a large text file and splits it into rows of 1800 or less (with headers). I’d like to execute commands like this from Lasso but not sure how to structure the sys_process code necessary to make this happen. Not having any luck after reading the LassoGuide on sys_process.
Any help from the list would be greatly appreciated.
Lasso 9.2.3
OSX 10.11.6
Server 5.2
Example:
——————————————————————————————————
#!/bin/bash
cd desktop/TargetFolder
FILE=$(ls -1 | grep ITEMS.txt)
NAME=${FILE%%.txt}
head -4 $FILE > header.txt
tail -n +5 $FILE > data.txt
split -l 1800 data.txt
for a in x??
do
cat header.txt $a > $NAME.$a.txt
done
mv $FILE $NAME.orig.txt
rm header.txt data.txt x??
——————————————————————————————————
Thank you,
Mark Romano
#############################################################
This message is sent to you because you are subscribed to
the mailing list Lasso Lasso@lists.lassosoft.com
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <Lasso-unsubscribe@lists.lassosoft.com>
Send administrative queries to <Lasso-request@lists.lassosoft.com>
Jun 06
Ke Carlton Re: Executing Terminal Commands
Jun 06, 2017; 22:21
Ke Carlton
Re: Executing Terminal Commands
Jun 07
Mark Romano Re: Executing Terminal Commands
Jun 07, 2017; 08:27
Mark Romano
Re: Executing Terminal Commands