+ Reply to Thread
Results 1 to 20 of 20

Creation of desired data (Output) from EDI file (Input)

Hybrid View

RavindraK Creation of desired data... 10-10-2018, 06:30 AM
RavindraK Re: Creation of desired data... 10-14-2018, 10:44 PM
JeteMc Re: Creation of desired data... 10-14-2018, 11:45 PM
RavindraK Re: Creation of desired data... 10-15-2018, 01:05 AM
FlameRetired Re: Creation of desired data... 10-15-2018, 10:38 AM
RavindraK Re: Creation of desired data... 10-16-2018, 01:33 AM
RavindraK Re: Creation of desired data... 11-05-2018, 08:18 AM
RavindraK Re: Creation of desired data... 11-07-2018, 01:37 AM
RavindraK Re: Creation of desired data... 11-11-2018, 10:48 PM
Winon Re: Creation of desired data... 11-14-2018, 03:02 AM
RavindraK Re: Creation of desired data... 11-23-2018, 06:01 AM
bakerman2 Re: Creation of desired data... 11-25-2018, 12:54 PM
RavindraK Re: Creation of desired data... 12-10-2018, 06:36 AM
bakerman2 Re: Creation of desired data... 12-10-2018, 10:57 AM
RavindraK Re: Creation of desired data... 12-10-2018, 11:08 PM
bakerman2 Re: Creation of desired data... 12-11-2018, 02:26 AM
RavindraK Re: Creation of desired data... 12-11-2018, 02:41 AM
bakerman2 Re: Creation of desired data... 12-11-2018, 10:15 AM
RavindraK Re: Creation of desired data... 12-11-2018, 10:37 PM
Pepe Le Mokko Re: Creation of desired data... 12-26-2018, 04:37 AM
  1. #1
    Forum Contributor
    Join Date
    07-19-2017
    Location
    Mumbai
    MS-Off Ver
    2013
    Posts
    305

    Creation of desired data (Output) from EDI file (Input)

    Dear Excel Experts,

    As a new practice, we have prepare data (OUTPUT) from avaibale (INPUT)

    Into INPUT worksheet 1st 9 rows are header part
    from 10th row container data is there

    Requirement / defination..
    POSITION After text LOC+147+0, 3 characters
    For Example : 131214 or 111116 etc.

    WT require text in between +WT++KGM: and '
    For Example : 16400 or 24700 etc

    WT (VGM) require text in between +VGM++KGM: and '
    For Example : 16400 or 24700 etc

    POD After text LOC+9+ , 5 characters
    For Example : CNTAO or CNSHA etc.

    POL After text LOC+11+ , 5 characters
    For Example : INMUN or INHZA etc.


    Contaienr NO After text EQD+CN+ , 11 characters
    For Example : AXIU2018854 or BMOU2709770 etc.


    Size After text EQD+CN+11characters+ , 4 characters
    For Example : 2200 or 4500 etc.


    Rfr If contain TMP+2+ text, require text in between TMP+2+ and ..: & a character after :
    For Example : -18C or +21 etc.

    Haz If contain DGS+IMD+ text, require text in between DGS+IMD+ and ..+
    For Example : 4.1 or 9 etc.

    UN If contain DGS+IMD+ text, require 4 character after text DGS+IMD+ ..+
    For Example : 2670 or 2211 etc.
    File attached for detailes (i have done manually for few container's details not all)
    Thanks in a davance
    RavindraK
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    07-19-2017
    Location
    Mumbai
    MS-Off Ver
    2013
    Posts
    305

    Re: Creation of desired data (Output) from EDI file (Input)

    Dear Excel Experts,
    Please help me to resolve the mentioned query.
    Thanks in a advance.

    Ravindrak

  3. #3
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 365 version 2501
    Posts
    19,043

    Re: Creation of desired data (Output) from EDI file (Input)

    This proposed solutions employs 12 helper columns (B:M) with various formulas to extract data from column A.
    Note that the helper columns may be moved and/or hidden for aesthetic purposes.
    The output range is in columns O:Z with column O containing the the container ID's (1...2345)
    Columns P:Z are populated using:
    Formula: copy to clipboard
    =IFERROR(INDEX(C$10:C$20943,AGGREGATE(15,6,(ROW($10:$20943)-9)/($B$10:$B$20943=$O9)/(C$10:C$20943<>""),1)),"")

    Note that I reduced the number of containers to 100 in order to meet the size constraints for uploading, however you should be able to complete the output table if you:
    1) paste the original data into column A starting with A913
    2) select B912:M912 and double click the fill handle
    3) select P108:Z108 and double click the fill handle (this process may take some time)
    Let us know if you have any questions.
    Attached Files Attached Files
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  4. #4
    Forum Contributor
    Join Date
    07-19-2017
    Location
    Mumbai
    MS-Off Ver
    2013
    Posts
    305

    Re: Creation of desired data (Output) from EDI file (Input)

    Superb Sir,
    You have done, what i have expected, only minor bug is...
    It is taking some time for opening and execution as it contains formula maximum based rows i.e. 6000 (i have extended from 2345 to 6000) .
    Can it be modified for fast execution?
    Ravindrak

  5. #5
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 V 2504
    Posts
    13,752

    Re: Creation of desired data (Output) from EDI file (Input)

    I can't find a way to do fast execution. One minor difference in JeteMc's upload is to replace the IFERROR. This is about 1½ - 2 seconds faster in P9:Z108. Since the numbers are actually text "numbers" this covers the errors
    Formula: copy to clipboard
    =LOOKUP("zzzz",CHOOSE({1,2},"",INDEX(C$10:C$20943,AGGREGATE(15,6,(ROW($10:$20943)-9)/($B$10:$B$20943=$O9)/(C$10:C$20943<>""),1))))
    is nothing to write home about. It may have more impact on large data though. Try it and see.
    Dave

  6. #6
    Forum Contributor
    Join Date
    07-19-2017
    Location
    Mumbai
    MS-Off Ver
    2013
    Posts
    305

    Re: Creation of desired data (Output) from EDI file (Input)

    Can it be done through macro, becasue macro will more faster than formulae

    This is just request Sirs. please check if possible.

    Thanks in a advance.

    Ravindrak

  7. #7
    Forum Contributor
    Join Date
    07-19-2017
    Location
    Mumbai
    MS-Off Ver
    2013
    Posts
    305

    Re: Creation of desired data (Output) from EDI file (Input)

    Dear Excel Experts,

    Can it be done through macro, becasue after deleteing old text and adding new text everytime, it hangs the system.

    Thanks in a advance.

    Ravindrak

  8. #8
    Forum Contributor
    Join Date
    07-19-2017
    Location
    Mumbai
    MS-Off Ver
    2013
    Posts
    305

    Re: Creation of desired data (Output) from EDI file (Input)

    Dear Excel Experts,

    Please help me to resolve the problem.

    Thanks in a advance.

    Ravindrak

  9. #9
    Forum Contributor
    Join Date
    07-19-2017
    Location
    Mumbai
    MS-Off Ver
    2013
    Posts
    305

    Re: Creation of desired data (Output) from EDI file (Input)

    Dear Excel Experts,

    Kindly help me to resolve the problem.

    Thanks in advance.

    Ravindrak

  10. #10
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Creation of desired data (Output) from EDI file (Input)

    Hello RavindraK,

    Can it be done through macro, because macro will more faster than formulae
    VBA and Macros are actually slower that any Standard Built in Excel Functions.

    You are covering a very large Range to be Calculated, hence the "delay" in processing your formulae.

    Regards.
    Please consider:

    Be polite. Thank those who have helped you. Then Click on the star icon in the lower left part of the contributor's post and add Reputation. Cleaning up when you're done. If you are satisfied with the help you have received, then Please do Mark your thread [SOLVED] .

  11. #11
    Forum Contributor
    Join Date
    07-19-2017
    Location
    Mumbai
    MS-Off Ver
    2013
    Posts
    305

    Re: Creation of desired data (Output) from EDI file (Input)

    Can anyone please help me to resolve my query.
    Thanks in advance.
    Ravindrak

  12. #12
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MSO Home and Business 2024
    Posts
    7,362

    Re: Creation of desired data (Output) from EDI file (Input)

    Try this one.

    Sub tst()
        t = Timer
        Dim res
        With Blad1
            sn = .Range("A10", .Range("A" & Rows.Count).End(xlUp))
        End With
        ReDim res(1 To UBound(sn) / 5, 1 To 11)
        rowNum = 0
        For i = 1 To UBound(sn)
            If Left(sn(i, 1), 7) Like "LOC+147" Then
                rowNum = rowNum + 1
                res(rowNum, 1) = Mid(sn(i, 1), 9, InStr(1, sn(i, 1), ":") - 9)
                
            ElseIf Left(sn(i, 1), 6) Like "MEA+WT" Then
                res(rowNum, 2) = Mid(sn(i, 1), 13, InStr(1, sn(i, 1), "'") - 13)
                
            ElseIf Left(sn(i, 1), 7) Like "MEA+VGM" Then
                res(rowNum, 3) = Mid(sn(i, 1), 14, InStr(1, sn(i, 1), "'") - 14)
                
            ElseIf Left(sn(i, 1), 5) Like "LOC+9" Then
                res(rowNum, 4) = Mid(sn(i, 1), 7, InStr(1, sn(i, 1), ":") - 7)
                
            ElseIf Left(sn(i, 1), 6) Like "LOC+11" Then
                res(rowNum, 5) = Mid(sn(i, 1), 8, InStr(1, sn(i, 1), ":") - 8)
            
            ElseIf Left(sn(i, 1), 6) Like "EQD+CN" Then
                res(rowNum, 6) = Mid(sn(i, 1), 8, 11)
                res(rowNum, 7) = Mid(sn(i, 1), 20, 4)
            
             ElseIf Left(sn(i, 1), 4) Like "TMP+" Then
                res(rowNum, 8) = Mid(sn(i, 1), 7, InStr(1, sn(i, 1), ":") - 7)
                
            On Error Resume Next
            ElseIf Left(sn(i, 1), 7) Like "DGS+IMD" Then
                res(rowNum, 9) = Mid(sn(i, 1), 9, InStr(9, sn(i, 1), "+") - 9)
                res(rowNum, 10) = Split(Replace(sn(i, 1), "+", "/", 9, 2), "/")(1)
            On Error GoTo 0
            
            ElseIf Left(sn(i, 1), 6) Like "NAD+CA" Then
                res(rowNum, 11) = Mid(sn(i, 1), 8, InStr(1, sn(i, 1), ":") - 8)
            End If
        Next
        With Blad1.Cells(1, 5)
            .CurrentRegion.Offset(1).ClearContents
            .Offset(1).Resize(UBound(res), 11) = res
        End With
        MsgBox Timer - t
    End Sub
    Attached Files Attached Files
    Last edited by bakerman2; 11-25-2018 at 08:31 PM.
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

  13. #13
    Forum Contributor
    Join Date
    07-19-2017
    Location
    Mumbai
    MS-Off Ver
    2013
    Posts
    305

    Re: Creation of desired data (Output) from EDI file (Input)

    Dear Sir,
    I am unable to open attached file.
    Also tried to add your given code in excel file but showing error at belwo line
    "sn = .Range("A10", .Range("A" & Rows.Count).End(xlUp))"

    Thanks in advance.
    Ravindrak

  14. #14
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MSO Home and Business 2024
    Posts
    7,362

    Re: Creation of desired data (Output) from EDI file (Input)

    Try this one.
    Attached Files Attached Files

  15. #15
    Forum Contributor
    Join Date
    07-19-2017
    Location
    Mumbai
    MS-Off Ver
    2013
    Posts
    305

    Re: Creation of desired data (Output) from EDI file (Input)

    Dear Sir,

    Executing as expected, excluding small error....

    Some of DGUN are appearing with single quotations mark (‘)
    Appearing Desired
    3349' 3349
    3082' 3082
    3272' 3272
    3352' 3352

    Please resolve the same.
    Thanks in advance.
    Ravindrak

  16. #16
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MSO Home and Business 2024
    Posts
    7,362

    Re: Creation of desired data (Output) from EDI file (Input)

    Sub tst()
        Dim res
        With Blad1
            sn = .Range("A10", .Range("A" & Rows.Count).End(xlUp))
        End With
        ReDim res(1 To UBound(sn) / 5, 1 To 11)
        rowNum = 0
        For i = 1 To UBound(sn)
            If Left(sn(i, 1), 7) Like "LOC+147" Then
                rowNum = rowNum + 1
                res(rowNum, 1) = Mid(sn(i, 1), 9, InStr(1, sn(i, 1), ":") - 9)
                
            ElseIf Left(sn(i, 1), 6) Like "MEA+WT" Then
                res(rowNum, 2) = Mid(sn(i, 1), 13, InStr(1, sn(i, 1), "'") - 13)
                
            ElseIf Left(sn(i, 1), 7) Like "MEA+VGM" Then
                res(rowNum, 3) = Mid(sn(i, 1), 14, InStr(1, sn(i, 1), "'") - 14)
                
            ElseIf Left(sn(i, 1), 5) Like "LOC+9" Then
                res(rowNum, 4) = Mid(sn(i, 1), 7, InStr(1, sn(i, 1), ":") - 7)
                
            ElseIf Left(sn(i, 1), 6) Like "LOC+11" Then
                res(rowNum, 5) = Mid(sn(i, 1), 8, InStr(1, sn(i, 1), ":") - 8)
            
            ElseIf Left(sn(i, 1), 6) Like "EQD+CN" Then
                res(rowNum, 6) = Mid(sn(i, 1), 8, 11)
                res(rowNum, 7) = Mid(sn(i, 1), 20, 4)
            
             ElseIf Left(sn(i, 1), 4) Like "TMP+" Then
                res(rowNum, 8) = Mid(sn(i, 1), 7, InStr(1, sn(i, 1), ":") - 7)
                
            On Error Resume Next
            ElseIf Left(sn(i, 1), 7) Like "DGS+IMD" Then
                res(rowNum, 9) = Mid(sn(i, 1), 9, InStr(9, sn(i, 1), "+") - 9)
                res(rowNum, 10) = Replace(Split(Replace(sn(i, 1), "+", "/", 9, 2), "/")(1), "'", "")
            On Error GoTo 0
            
            ElseIf Left(sn(i, 1), 6) Like "NAD+CA" Then
                res(rowNum, 11) = Mid(sn(i, 1), 8, InStr(1, sn(i, 1), ":") - 8)
            End If
        Next
        With Blad1.Cells(1, 5)
            .CurrentRegion.Offset(1).ClearContents
            .Offset(1).Resize(UBound(res), 11) = res
        End With
    End Sub

  17. #17
    Forum Contributor
    Join Date
    07-19-2017
    Location
    Mumbai
    MS-Off Ver
    2013
    Posts
    305

    Re: Creation of desired data (Output) from EDI file (Input)

    Thanks a lot Sir,
    It's running perftectly, you are really charm !!

    I tried to changing name from Blad1 to Ravi; changed the same in code as well as worksheet/tab name, but after changing it is not running, can you do something for the same

    Ravindrak

  18. #18
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MSO Home and Business 2024
    Posts
    7,362

    Re: Creation of desired data (Output) from EDI file (Input)

    Sub tst()
        Dim res
        With Sheets("Ravi")
            sn = .Range("A10", .Range("A" & Rows.Count).End(xlUp))
        End With
        ReDim res(1 To UBound(sn) / 5, 1 To 11)
        rowNum = 0
        For i = 1 To UBound(sn)
            If Left(sn(i, 1), 7) Like "LOC+147" Then
                rowNum = rowNum + 1
                res(rowNum, 1) = Mid(sn(i, 1), 9, InStr(1, sn(i, 1), ":") - 9)
                
            ElseIf Left(sn(i, 1), 6) Like "MEA+WT" Then
                res(rowNum, 2) = Mid(sn(i, 1), 13, InStr(1, sn(i, 1), "'") - 13)
                
            ElseIf Left(sn(i, 1), 7) Like "MEA+VGM" Then
                res(rowNum, 3) = Mid(sn(i, 1), 14, InStr(1, sn(i, 1), "'") - 14)
                
            ElseIf Left(sn(i, 1), 5) Like "LOC+9" Then
                res(rowNum, 4) = Mid(sn(i, 1), 7, InStr(1, sn(i, 1), ":") - 7)
                
            ElseIf Left(sn(i, 1), 6) Like "LOC+11" Then
                res(rowNum, 5) = Mid(sn(i, 1), 8, InStr(1, sn(i, 1), ":") - 8)
            
            ElseIf Left(sn(i, 1), 6) Like "EQD+CN" Then
                res(rowNum, 6) = Mid(sn(i, 1), 8, 11)
                res(rowNum, 7) = Mid(sn(i, 1), 20, 4)
            
             ElseIf Left(sn(i, 1), 4) Like "TMP+" Then
                res(rowNum, 8) = Mid(sn(i, 1), 7, InStr(1, sn(i, 1), ":") - 7)
                
            On Error Resume Next
            ElseIf Left(sn(i, 1), 7) Like "DGS+IMD" Then
                res(rowNum, 9) = Mid(sn(i, 1), 9, InStr(9, sn(i, 1), "+") - 9)
                res(rowNum, 10) = Replace(Split(Replace(sn(i, 1), "+", "/", 9, 2), "/")(1), "'", "")
            On Error GoTo 0
            
            ElseIf Left(sn(i, 1), 6) Like "NAD+CA" Then
                res(rowNum, 11) = Mid(sn(i, 1), 8, InStr(1, sn(i, 1), ":") - 8)
            End If
        Next
        With Sheets("Ravi").Cells(1, 5)
            .CurrentRegion.Offset(1).ClearContents
            .Offset(1).Resize(UBound(res), 11) = res
        End With
    End Sub

  19. #19
    Forum Contributor
    Join Date
    07-19-2017
    Location
    Mumbai
    MS-Off Ver
    2013
    Posts
    305

    Re: Creation of desired data (Output) from EDI file (Input)

    Yesterday, i marked this post as SOLVED but still you have resolved small issue.
    Thanks a lot sir for your great help, hats off to you Boss.
    Ravindrak

  20. #20
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2504
    Posts
    13,633

    Re: Creation of desired data (Output) from EDI file (Input)

    It has come to our attention you have violated Rule 8 of our Forum RULES. Don't Private Message, Visitor message or email Excel questions to moderators or other members. (Or Access, Word, etc.)

    All questions and answers will benefit other posters like yourself when discussed in public threads. The point of having a public forum is to share solutions to common (and sometimes uncommon) problems with all members.

    Breaking this rule is considered harassment by most of our contributors and thus cannot be tolerated. Repeat offense could lead to permanent ban, so do take this caution to heart.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Macro use input file name as output name
    By jlcalhoun in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-06-2015, 06:14 AM
  2. Replies: 3
    Last Post: 09-15-2015, 06:07 AM
  3. [SOLVED] Web Query - Website requires data input before it shows desired data
    By Anon2266 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 07-31-2014, 12:48 PM
  4. Auto creation of sheets based on Data sheet with a sample output shown next to it
    By paradise2sr in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 11-27-2013, 07:56 AM
  5. Replies: 0
    Last Post: 10-03-2013, 02:02 AM
  6. [SOLVED] Hyperlink to file. Input/Output processing error Reported
    By pj.chris@verizon.net in forum Excel General
    Replies: 11
    Last Post: 05-01-2005, 10:06 PM
  7. creation of data input window in excel
    By revrenddan in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-23-2005, 12:06 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1