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 8470135
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T16:25:56+00:00 2026-06-10T16:25:56+00:00

I have a text file which contain rows in this format: com1,System Access,MinimumPasswordAge,1 com1,System

  • 0

I have a text file which contain rows in this format:

com1,System Access,MinimumPasswordAge,1
com1,System Access,MaximumPasswordAge,42
com1,System Access,MinimumPasswordLength,7

I wish to import this data in 3 seperate rows in the following format:

“com1” in ID column,
“System Access” in Audit_Type column,
“MinimumPasswordAge” in System_Setting column, and
“1” in Actual_Value column.

Im using MySQL Query Browser in Windows 7 SP1.

  • 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-10T16:25:58+00:00Added an answer on June 10, 2026 at 4:25 pm
    1. Create table to hold your data.

    2. Create CSV file. Do not include field headers.

    3. Open MySQL Query Browser and run SQL:


    load data local infile 'fullpath.csv' into table tableName
    fields terminated by ','
    lines terminated by '\n'
    (ID, Audit_Type, System_Setting, Actual_Value);
    

    Note:
    If you have generated the text file on a Windows system, you might have to use LINES TERMINATED BY '\r\n' to read the file properly, because Windows programs typically use two characters as a line terminator.


    UPDATE 1

    As you can see, 3 out of 81 records are only inserted

    com1,System Access,MinimumPasswordAge,1
    com2,System Access,MinimumPasswordAge,1
    com3,System Access,MinimumPasswordAge,1

    others fail

    com1,Event Audit,AuditSystemEvents,0
    com2,Kerberos Policy,MaxTicketAge,10
    com3,System Access,NewAdministratorNameAdministrator, 1

    It’s because you set the column ID as the primary key. com1, com2, com3 already existed on the table. Primary Key is, by definition, unique. The best way to do to be able to insert all rows is by creating another column which whill be auto-incremented and set this as primary key.

    Create Table system_settings
    (
        RecordID int NOT NULL AUTO_INCREMENT,
        ID VARCHAR(30),
        Audit_Type VARCHAR(30), 
        System_Setting VARCHAR(30), 
        Actual_Value int,
        CONSTRAINT table_PK PRIMARY KEY (RecordID) 
    )
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this text file which might contain some unsupported characters in the Latin1
I have a text file which contains something like this: Hello, my name is
I have a text file which contain following type item wett45456,4556,45657,898 tyu5878,4566,7989,55565 now i
I have a text file which all contain the following fragments of code in
i have some text file which contain proxy ip . which look like following
I have a text file which contains data seperated by '|'. I need to
I have a simple text dictionary file, which contains words, separated by ';'.My problem
I have a text file which has a particular line something like sometext sometext
I have a text file which I am reading and storing the data in
I have a text file which I want to filter using awk. The text

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.