Converting macro to bash script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Converting macro to bash script
# 1  
Old 02-19-2015
Converting macro to bash script

Gents,

Please can you help me with this.

When column 49 == 2

Before
Code:
X  4714     14710  69445.00  19257.001 1218 12271  69596.00  19460.00  19478.001
X  4714     14710  69445.00  19257.001 1228 12292  69596.00  19480.00  19480.001

After
Code:
X  4714     14710  69445.00  19257.001 1218 12281  69596.00  19460.00  19480.001
X  4714     14710  69445.00  19257.001 1229 12291  69608.00  19480.00  19480.001

Need to do the following changes;
Change previous row field (substr$0,45,4)-1
Change previous row field (substr$0,72,5)+2
Change actual row field (substr$0,40,4)+1
Change actual row field (substr$0,49,1)-1
Change actual row field (substr$0,62,5)+12

Before
Code:
X  4714     14710  69445.00  19257.001 1218 12271  69596.00  19460.00  19478.001
X  4714     14710  69445.00  19257.001 1228 12292  69596.00  19480.00  19480.001

After
Code:
X  4714     14710  69445.00  19257.001 1218 12281  69596.00  19460.00  19480.001
X  4714     14710  69445.00  19257.001 1229 12291  69608.00  19480.00  19480.001


Last edited by jiam912; 02-19-2015 at 10:15 AM..
# 2  
Old 02-19-2015
No offence but I haven't looked at VB in over 20 years, have never written Office mcros, and have no desire to start now...

Could you describe your requirements in English rather than with reference to an Excel handling library that many here would have no cognisance of.
This User Gave Thanks to Skrynesaver For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Converting awk script from bash to csh

I have the following script set up and working properly in bash. It basically copies a set of lines which match "AS1100002" from one file and replaces the same lines in another file. awk -vN=AS1100002* 'NR==FNR { if($1 ~ N)K=$0; next } { if($1 in K) $0=K; print }' $datadir/file1... (7 Replies)
Discussion started by: ncwxpanther
7 Replies

2. Shell Programming and Scripting

Please help me with converting the below bash script in C shell script

#!/bin/sh # $Header: hot_database_backup.sh,v 1.2 2002/08/06 23:51:42 $ # #bcpyrght #*************************************************************************** #* $VRTScprght: Copyright 1993 - 2007 Symantec Corporation, All Rights Reserved $ *... (2 Replies)
Discussion started by: apade
2 Replies

3. Shell Programming and Scripting

Converting from Linux bash (GNU) to Solaris script syntax errors

Original script written on CentOS 6.3 with GNU bash 4.1.2 Destination system is Solaris 9 with GNU bash 2.05 (not changeable by me) I have a script written on the linux side but now we need to provide a version to another site that "doesn't like linux". I've been going through changing the ] or... (13 Replies)
Discussion started by: oly_r
13 Replies

4. Shell Programming and Scripting

Converting date/time and generating offsets in bash script

Hi all, I need a script to do some date/time conversion. It should take as an input a particular time. It should then generates a series of offsets, in both hour:minute form and number of milliseconds elapsed. For 03:00, for example, it should give back 04:02:07 (3727000ms*) 05:04:14... (2 Replies)
Discussion started by: emdan
2 Replies

5. Shell Programming and Scripting

Invoke a script in UNIX using Excel Macro

Hi, I am using Send Keys to connect to UNIX server and invoke a script . Is there an alternate way to connect to UNIX server using Excel macro and invoke a UNIX Shell script? Anu (2 Replies)
Discussion started by: anandita.jha
2 Replies

6. UNIX for Dummies Questions & Answers

Wanting to run a macro/script from PuTTY

We currently use TUN as an emulation program to connect to various unix applications. I am looking at moving to PuTTY release 0.60 but am getting stuck as one application runs a macro at startup to run a program. My question is, can you run a macro from PuTTY? Any pointers would be great. (0 Replies)
Discussion started by: virtualpaul
0 Replies

7. Programming

Make-question - redefine a macro, using another macro..?

I think there is no problem to use any macro in a new macro definishion, but I have a problem with that. I can not understand why? I have a *.mak file that inludes file with many definitions and rules. ############################################## include dstndflt.mak ... One of the... (2 Replies)
Discussion started by: alex_5161
2 Replies

8. Shell Programming and Scripting

how to converting rows to columns, bash

I have in file these words: @fraza1 = rw @fraza2 = r @fraza3 = r @fraza4 = r @fraza5 = r @fraza1 = r @fraza6 = r @fraza7 = r @fraza2 = r @fraza8 = r @fraza9 = r ... I would like so that: ,rw,@fraza1 ,r,@fraza2 (2 Replies)
Discussion started by: patrykxes
2 Replies

9. Shell Programming and Scripting

Converting bash script to csh

Hi, I'm a beginner in scripting and I recently wrote a bash script that would've worked fine until I realized it needed to be written in csh. Could someone please show me how to correctly change the syntax from bash to csh in this script? Any help will be greatly appreciated. I can provide more... (4 Replies)
Discussion started by: Kweekwom
4 Replies

10. UNIX for Dummies Questions & Answers

macro on shell script ?

in shifts we used to run a script where in we need to choose from different options. for example the first part would go like this: ======== menu ======== 1)blah 2)blah blah 3)blah blah blah you have chosen: then after that a series of multiple choice so on and so forth...what i would... (4 Replies)
Discussion started by: inquirer
4 Replies
Login or Register to Ask a Question