Fr:Importer et Exporter des Fichiers Texte CSV dans Calc

From NeoWiki

(Difference between revisions)
Jump to: navigation, search
Revision as of 19:33, 20 April 2007 (edit)
Jgd (Talk | contribs)
(botlangbar -> En)
← Previous diff
Current revision (21:38, 18 October 2010) (edit) (undo)
Sardisson (Talk | contribs)
(add Fixed-Width ASCII section from en version)
 
(One intermediate revision not shown.)
Line 1: Line 1:
 +{{fr:Fixme}}
Le format de fichier Texte CSV (Comma Separated Values) sépare les champs de données par des délimiteurs comme les virgules, tabulations, etc. L'utilisation de ce format dans NeoOffice vous permet d'afficher les données d'un fichier texte dans un classeur et de les utiliser comme base de données. Inversement, vous pouvez exporter les données d'une feuille de classeur dans un document texte. Le format de fichier Texte CSV (Comma Separated Values) sépare les champs de données par des délimiteurs comme les virgules, tabulations, etc. L'utilisation de ce format dans NeoOffice vous permet d'afficher les données d'un fichier texte dans un classeur et de les utiliser comme base de données. Inversement, vous pouvez exporter les données d'une feuille de classeur dans un document texte.
Line 19: Line 20:
* Dans la fenêtre {{window|Export de texte}}, choisissez le {{section|Jeu de caractères}}, par ex. {{prefName|Unicode (UTF-8)}} et le {{section|Séparateur de champs}}, par ex. {{prefName|{Tab} }}. * Dans la fenêtre {{window|Export de texte}}, choisissez le {{section|Jeu de caractères}}, par ex. {{prefName|Unicode (UTF-8)}} et le {{section|Séparateur de champs}}, par ex. {{prefName|{Tab} }}.
* Cliquez sur {{button|OK}}. * Cliquez sur {{button|OK}}.
-* Le fichier peut être converti en format <tt>.txt</tt> en modifiant l'extension dans le Finder : sélectionnez-le, pressez la touche {{key|Retour}} ou {{key|Entrée}} afin de pouvoir éditer le nom du fichier, et remplacez <tt>.csv</tt> par <tt>.txt</tt>.+* Le fichier peut être converti en format <tt>.txt</tt> en modifiant l'extension dans le Finder : sélectionnez-le, pressez la touche {{key|Retour}} ou {{key|Entrée}} afin de pouvoir éditer le nom du fichier, et remplacez <tt>.csv</tt> par <tt>.txt</tt>. (depending on your setting for displaying extensions in the Finder, you may have to select the file, choose {{menu|Get Info}} from the {{menu|File}} menu, expand the {{section|Name & Extension}} section, and modify the filename and/or uncheck the {{prefName|Hide extension}} checkbox).
 +==Exporting a Spreadsheet as a Fixed-Width ASCII File==
 +For some scientific or mathematical applications, you may need to export data from a spreadsheet in a fixed-width ASCII format (also known as a "space-separated" format; Excel calls this format a “.prn” file). NeoOffice supports this, but rather than selecting a special file type, you must save the spreadsheet using the Text CSV format and set filter options.
-{{botlangbarFR|[[:Importing and Exporting Comma and Tab Delimited Files|English]]}}+* Begin preparing the spreadsheet for export by first selecting all columns with data in them.
 +* Then choose {{menu|Optimal Width...}} from the {{menu|Columns}} sub-menu of the {{menu|Format}} menu.
 +* In the {{window|Optimal Column Width}} window, make sure the {{prefName|Default value}} checkbox is checked and that the {{prefName|Add}} field shows '''0.1"''' (or the equivalent value in metric units) if you want each “column” of data in the ASCII file to be separated by a single space. If you do not have at least '''0.1"''' (or the equivalent) added to the optimal column width, data from one “column” in the ASCII file will directly abut data from the next column.
 +* Now choose the {{menu|File}} menu, then the {{menu|Save As…}} item.
 +* A dialog opens. In the {{section|File type}} drop-down menu choose {{prefName|Text CSV (.csv)}}.
 +* Select {{prefName|Edit filter settings}}
 +* Give your document a name and choose the location where you want save it. Click {{button|Save}}.
 +<!-- * In the window where you are asked for confirmation, click {{button|Yes}} to save the file in Text CSV format. -- I don't see this confirmation window, so hiding -->
 +* In the {{window|Export of text files}} window, choose the {{prefName|Character set}}, e.g. {{prefName|Unicode (UTF-8)}}, and then check the {{prefName|Fixed column width}} checkbox.
 +* Click {{button|OK}}.
 +* The file can be converted into <tt>.prn</tt> format by changing the extension in the Finder: select the file, then press {{key|Return}} or {{key|Enter}} and replace <tt>.csv</tt> with <tt>.prn</tt> (depending on your setting for displaying extensions in the Finder, you may have to select the file, choose {{menu|Get Info}} from the {{menu|File}} menu, expand the {{section|Name & Extension}} section, and modify the filename and/or uncheck the {{prefName|Hide extension}} checkbox).
 + 
 + 
 +{{botlangbarFR|[[:Importing and Exporting Comma and Tab Delimited Files|English]] [[It:Importare_file_delimitati_da_virgole_o_tabulazioni|Italiano]]}}
[[Category:Tips and Hints]][[Category:NeoOffice]][[Category:NeoWikiFR]] [[Category:Tips and Hints]][[Category:NeoOffice]][[Category:NeoWikiFR]]

Current revision

Cet article n'est pas à jour.

Le format de fichier Texte CSV (Comma Separated Values) sépare les champs de données par des délimiteurs comme les virgules, tabulations, etc. L'utilisation de ce format dans NeoOffice vous permet d'afficher les données d'un fichier texte dans un classeur et de les utiliser comme base de données. Inversement, vous pouvez exporter les données d'une feuille de classeur dans un document texte.

Importer un Fichier Texte dans Calc

Pour importer un fichier enregistré en format .txt ou .csv, procédez de la manière suivante :

  • Dans le menu Fichier, choisissez Ouvrir….
  • Dans la fenêtre de dialogue, dans le menu déroulant Type de fichier choisissez Texte CSV.
  • Sélectionnez le fichier que vous voulez importer et cliquez sur Ouvrir.
  • Dans la fenêtre de dialogue Import de texte, sélectionnez la ligne à partir de laquelle vous voulez importer le texte ainsi que le séparateur utilisé dans le fichier que vous importez, par ex. Tabulations.
  • Dans la section Champs, choisissez le Type à attribuer à chaque colonne. Vous pouvez aussi masquer certaines colonnes, elles ne seront pas importées.
  • Cliquez sur OK.
    N.B Si le fichier porte l'extension .csv, il suffit de double-cliquer dessus pour afficher directement la fenêtre de dialogue Import de texte.

Exporter une Feuille de Classeur en Format Texte

  • Dans la feuille de calcul que vous voulez exporter, allez dans le menu Fichier puis dans le sous-menu Enregistrer sous….
  • Dans la fenêtre de dialogue qui s'ouvre, dans le menu déroulant Type de fichier choisissez Texte CSV (.csv).
  • Cochez la case Éditer les paramètres de filtre.
  • Donnez un nom à votre document et choisissez l'emplacement où vous voulez l'enregistrer. Cliquez sur Enregistrer.
  • Dans la fenêtre demandant la confirmation de l'enregistrement dans le format Texte CSV, cliquez sur Oui
  • Dans la fenêtre Export de texte, choisissez le Jeu de caractères, par ex. Unicode (UTF-8) et le Séparateur de champs, par ex. {Tab} .
  • Cliquez sur OK.
  • Le fichier peut être converti en format .txt en modifiant l'extension dans le Finder : sélectionnez-le, pressez la touche Retour ou Entrée afin de pouvoir éditer le nom du fichier, et remplacez .csv par .txt. (depending on your setting for displaying extensions in the Finder, you may have to select the file, choose Get Info from the File menu, expand the Name & Extension section, and modify the filename and/or uncheck the Hide extension checkbox).

Exporting a Spreadsheet as a Fixed-Width ASCII File

For some scientific or mathematical applications, you may need to export data from a spreadsheet in a fixed-width ASCII format (also known as a "space-separated" format; Excel calls this format a “.prn” file). NeoOffice supports this, but rather than selecting a special file type, you must save the spreadsheet using the Text CSV format and set filter options.

  • Begin preparing the spreadsheet for export by first selecting all columns with data in them.
  • Then choose Optimal Width... from the Columns sub-menu of the Format menu.
  • In the Optimal Column Width window, make sure the Default value checkbox is checked and that the Add field shows 0.1" (or the equivalent value in metric units) if you want each “column” of data in the ASCII file to be separated by a single space. If you do not have at least 0.1" (or the equivalent) added to the optimal column width, data from one “column” in the ASCII file will directly abut data from the next column.
  • Now choose the File menu, then the Save As… item.
  • A dialog opens. In the File type drop-down menu choose Text CSV (.csv).
  • Select Edit filter settings
  • Give your document a name and choose the location where you want save it. Click Save.
  • In the Export of text files window, choose the Character set, e.g. Unicode (UTF-8), and then check the Fixed column width checkbox.
  • Click OK.
  • The file can be converted into .prn format by changing the extension in the Finder: select the file, then press Return or Enter and replace .csv with .prn (depending on your setting for displaying extensions in the Finder, you may have to select the file, choose Get Info from the File menu, expand the Name & Extension section, and modify the filename and/or uncheck the Hide extension checkbox).



Cet article dans d'autres langues : English Italiano
Personal tools