As a part of Ab Initio Reformat i need to map input fields to output and covert as per there datatype. I wrote a vba script to automate that. PFB
Sub reformat()
Dim sel As String
Dim j As String
sel = ""
Sheet1.Activate
k = Cells(Rows.Count, "A").End(xlUp).Row
MsgBox (k - 1)
For i = 2 To k
If Cells(i, 2).Value = "1" Then
Cells(i, 5).Value = "out." + Cells(i, 1).Value + "::" + "in." + Cells(i, 4).Value
End If
If Cells(i, 2).Value = "Lkp" Then
Cells(i, 5).Value = "out." + Cells(i, 1).Value + "::" + "first_imp(" + Cells(i, 3) + ")." + "in." + Cells(i, 4).Value
End If
If Cells(i, 2).Value = "DT" Then
Cells(i, 5).Value = "out." + Cells(i, 1).Value + "::" + Cells(i, 3) + "in." + Cells(i, 4)
End If
Next i
The output is like,
Input Datatype Target
abc string abc out.abc::in.abc
gbf decimal gbf out.gbf::(decimal(""))in.gbf
I want to write this code in Unix so that i can remove the dependency of going to Windows performing this and copying result back to Unix. I can place file in Unix like:
Input|Datatype|Target
abc|string|abc
gbf|decimal|gbf
And i am trying to get output file as:
out.abc::in.abc
out.gbf::(deicmal(""))in.gbf
Please help not that much aware of Shell scripting