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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T15:23:42+00:00 2026-06-17T15:23:42+00:00

I need to use a single command line to fetch a set of records

  • 0

I need to use a single command line to fetch a set of records from a database.
If I do this:

$ sqlite3 con.db "SELECT name,cell,email FROM contacts"

I get output with a separator “|”, where the output looks like this:

Alison|+12345678|alison@mail.com
Ben|+23456789|ben@mail.com
Steve|+34567890|steve@mail.com

Is there a way (in single command line format like specified above) to change the output field separator to something else, like “;;;” or something else or more unique. This is because the output occasionally get the character “|” inside the records, and it causes issues.

My desired result is:

Alison;;;+12345678;;;alison@mail.com
Ben;;;+23456789;;;ben@mail.com
Steve;;;+34567890;;;steve@mail.com

Or any other unique separator, which is not likely to be found inside the values.

(The command is executed on a Linux machine)

Thank you.

  • 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-17T15:23:44+00:00Added an answer on June 17, 2026 at 3:23 pm

    The -separator option does what you want:

    sqlite3 -separator ';;;' con.db "SELECT ..."
    

    The only way to format the output so that you are guaranteed to not get the separator in the values is to quote all strings:

    sqlite3 con.db "SELECT quote(name), quote(cell), quote(email) FROM contacts"
    

    However, this would require you to parse the output according to the SQL syntax rules.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

TL;DR Summary: I need a single command-line application which I can use to get
I'm trying to use this DataBase that come with this sample project with from
In the standalone application(single threaded command line tool) I am developing ,I use Spring
Something equivalent to this command line: set PATH=%PATH%;C:\Something\bin To run my application, some thing
I need use this method with three distinct classes: Orders, Customers, Suppliers public void
I need use this code: <%= button_tag :class => btn btn-primary do %> <%=
So, I need use this event so I can navigate trought blog posts. I
I need to use unix Style line endings (only LF) in Zend Studio 8/9
What command line util can i use to create a thumbnail preview of a
I would like to use curl, on the command line, to grab a url,

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.