Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8815669
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T04:26:10+00:00 2026-06-14T04:26:10+00:00

I have this data in my file 65 — 66 FieldType: Text 67 FieldName:

  • 0

I have this data in my file

 65 ---
 66 FieldType: Text
 67 FieldName: STATE
 68 FieldNameAlt: STATE
 69 FieldFlags: 4194304
 70 FieldJustification: Left
 71 FieldMaxLength: 2
 72 ---
 73 FieldType: Text
 74 FieldName: ZIP
 75 FieldNameAlt: ZIP
 76 FieldFlags: 0
 77 FieldJustification: Left
 78 ---
 79 FieldType: Signature
 80 FieldName: EMPLOYEE SIGNATURE
 81 FieldNameAlt: EMPLOYEE SIGNATURE
 82 FieldFlags: 0
 83 FieldJustification: Left
 84 ---
 85 FieldType: Text
 86 FieldName: Name_Last
 87 FieldNameAlt: LAST
 88 FieldFlags: 0
 89 FieldValue: Billa
 90 FieldJustification: Left
 91 ---

How can i make that a array and store as key value pair in array like

array['fieldtype']
array['fieldName']

for all the objects.

i think the separater is only “—” but i don’t know how can i do that

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T04:26:11+00:00Added an answer on June 14, 2026 at 4:26 am

    Here’s one way with GNU awk. It splits the input into records which can then be worked on.

    parse.awk

    BEGIN {
      RS = " +[0-9]+ +---\n"
      FS = "\n"
    }
    
    {
      for(i=1; i<=NF; i++) {             # for each line
        sf = split($i, a, ":")
        if(sf > 1) {                     # only accept successfully split lines
          sub("^ +[0-9]+ +", "", a[1])   # trim key
          sub("^ +", "",  a[2])          # trim value
          array[a[1]] = a[2]             # save into array hash
        }
      }
    }
    
    {
      print "Record: " NR
      for(k in array) {
        print k " -> " array[k]
      }
      print ""
    }
    

    Save the above into parse.awk and run it like this:

    awk -f parse.awk infile
    

    Where infile contains the data you want to parse. Output:

    Record: 1
    
    Record: 2
    FieldFlags -> 4194304
    FieldNameAlt -> STATE
    FieldJustification -> Left
    FieldType -> Text
    FieldMaxLength -> 2
    FieldName -> STATE
    
    Record: 3
    FieldFlags -> 0
    FieldNameAlt -> ZIP
    FieldJustification -> Left
    FieldType -> Text
    FieldMaxLength -> 2
    FieldName -> ZIP
    
    Record: 4
    FieldFlags -> 0
    FieldNameAlt -> EMPLOYEE SIGNATURE
    FieldJustification -> Left
    FieldType -> Signature
    FieldMaxLength -> 2
    FieldName -> EMPLOYEE SIGNATURE
    
    Record: 5
    FieldFlags -> 0
    FieldNameAlt -> LAST
    FieldJustification -> Left
    FieldType -> Text
    FieldMaxLength -> 2
    FieldValue -> Billa
    FieldName -> Name_Last
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is the data in my text file: (I have shown 10 rows out
I have this data from a xml file: <?xml version=1.0 encoding=utf-8 ?> <words> <id>...</id>
I have problem with this code: file = tempfile.TemporaryFile(mode='wrb') file.write(base64.b64decode(data)) file.flush() os.fsync(file) # file.seek(0)
I have a data file that looks like this: xyz123 2.000 -0.3974 0.0 hij123
I have this excel file which I have been able to write the data
I have a file containing some data (for example, 00927E2B112DB958......). This data is a
I have this HTML: <form action='uploadhandle.php' method='POST' enctype=multipart/form-data> <input type='file' class='fileinput' id='photo1' name='photo1'> <input
I have 'data.xlsx' file with cells of numbers and letters. when I run this
I have a file like this ### SECTION 1 ### data data data data
I have this data file, which is supposed to be a normal ASCII file.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.